microsoft / vscode-typescript-tslint-plugin

VS Code extension that provides TSLint support using the typescript-tslint-plugin
https://marketplace.visualstudio.com/items?itemName=ms-vscode.vscode-typescript-tslint-plugin
MIT License
188 stars 34 forks source link

Lint entire workspace or project. #20

Closed dmitryshunkov closed 5 years ago

dmitryshunkov commented 5 years ago

I have installed plugin locally in workspace following these instructions. And tslint now shows errors only for opened files. Is it possible to configure plugin to show issues in Problems tab for all files in entire project? Is it possible to configure problem matcher as for old tslint plugin?

dmitryshunkov commented 5 years ago

So, in order to see all errors I added tasks.json file with next content:

{
    "version": "2.0.0",
    "tasks": [
        {
            "type": "npm",
            "script": "lint",
            "problemMatcher": {
                "base": "$tslint5",
                "fileLocation": "absolute"
            }
        }
    ]
}

and installed plugin itself. To see errors in Problems tab lint task should be run with Run Task.

mjbvz commented 5 years ago

Yes you need the VS Code extension to get the problem matcher, not just the plugin

DanTup commented 5 years ago

@mjbvz I have the new plugin installed but I'm only seeing issues for open files also. I already have the code above (from when I used the other plugin - which I've now removed).

I'm fairly sure that the lints used to just show up when I hit build (Cmd+Shift+B or run with F5) and the watcher was running, I never had to explicitly run a command before. Has this changed, or have I done something wrong?

DanTup commented 5 years ago

Actually, I'm not sure if I've set this up right - that task just calls tslint, and this appears in the output:

> dart-code@2.20.1-dev lint /Users/dantup/Dev/Dart-Code
> tslint src/**/*.ts -t verbose

Warning: The 'no-floating-promises' rule requires type information.

It sounds like this extension is supposed to be using the running server, and running this lint command is presumably not doing that?