I added TSLint to my React/TypeScript project using the tslint VSCode extension. I also installed both typescript and tslint globally according to TSLint docs npm install -g tslint typescript
This is my tslint.json file:
{ "extends": ["tslint:latest", "tslint-react"], "rules": { // override tslint-react rules here "jsx-wrap-multiline": false, "max-line-length": false, "no-implicit-dependencies": [true, "dev"], "no-var-requires": false, "indent": false } }
TSLint has been the recommended linter in the past but now TSLint is deprecated and ESLint is taking over its duties.
tslint-react
is a tslint extension which has to be installed separately: npm install -g tslint-react
. After installing, reload your VS Code window, and linting should work.
How I found the problem: I copied your config file into a project, went to View > Output to check for errors from the tslint process, and saw this. (be sure to select tslint from the dropdown near the top right)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With