6
votes

So, I have my tsconfig.json and tslint.json at the root of my project. When I run tslint, it displays all of the errors in Terminal. But I do not get any hints/lines in VS Code. I'm driving myself crazy trying to figure out why it won't work. I deliberately went against a rule but nothing happens. I've tried force-quitting several times. I've tried other rules and going against them. (Note, I am not talking about the VSCode extension for TSLint.) I wrote a pretty basic one:

{
    "defaultSeverity": "error",
    "extends": [
        "tslint:recommended"
    ],
    "jsRules": {},
    "rules": {
        "quotemark": [
            true,
            "single",
            "avoid-escape"
        ],
        "semicolon": [
            true,
            "always"
        ]
    },
    "rulesDirectory": []
}
1
I have this under my scripts in my package.json - "lint": "tslint ./src/**/*.ts --exclude \"./**/node_modules/**/*.ts\""Clayton Ray
Do you have TypeScript and TSLint installed globally in npm? You need to have both installed globally for tslint to work. npm install typescript tslint -gkenhowardpdx
Yep. I even tried with yarn too. Made no differenceClayton Ray
This is not clear for me: You have installed the tslint extension right? Can you set up a basic example repo, so we can check it out? :-/Sebastian Sebald
I filed an issue on Github. Yeah, I didn't mean that I don't have the extension. I meant that I wasn't going against the extension's default rules; I was going against my rules, which I showed above in the code block. I actually got it working, but I am not sure what part did it. Here's the issue: github.com/Microsoft/vscode-tslint/issues/248Clayton Ray

1 Answers

1
votes

If you have not installed tslint extension and do not run tslint via task manually - VSCode will not "check" its rules.

VSCode has no "embedded" support of the tslint. You must install the aforementioned extension in order to get intellisense support you are looking after.