Note: This extension has been deprecated in favor of the vscode-typescript-tslint-plugin. To learn about the differences between vscode-tslint and the new extension please refer to this document.
Integrates the tslint linter for the TypeScript language into VS Code.
Please refer to the tslint documentation for how to configure the linting rules.
The extension requires that the
typescript modules are installed either locally or globally. The extension will use the tslint module that is installed closest to the linted file. To install tslint and typescript globally you can run
npm install -g tslint typescript.
no-unused-variable rule doesn't report warnings any more?
Since tslint version 5 the rule no-unused-variable requires type information. Rules with type information are currently not supported by vscode-tslint, pls see issue #70. The recommended work around is to enable the TypeScript compiler options
noUnusedParameters in your
You can use the TypeScript setting
typescript.reportStyleChecksAsWarnings to define whether
noUnusedParameters are reported as warnings or errors. By default the setting is true.
How can I use tslint rules that require type information
The recommended way is to run tslint manually on your project from a task. To see the lint warnings in the Problems panel you can associate the task with a Problem matcher as described in the section below.
- First linting is very slow #287
When you have installed tslint globally using
npm install -g then you can get hit by a performance issue in npm. The command to determine the location of the global node modules can be very slow with version 5 of npm. This problem could not be reproduce with npm version 4.2. You can work around this issue by:
- installing tslint locally for you project using
npm install tslint