Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

TSLint not working in VS Code

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   } } 
like image 681
blankface Avatar asked Apr 11 '18 23:04

blankface


People also ask

Is TSLint deprecated?

TSLint has been the recommended linter in the past but now TSLint is deprecated and ESLint is taking over its duties.


1 Answers

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)

Invalid "extends" configuration value - could not require "tslint-react"

like image 68
ecraig12345 Avatar answered Oct 02 '22 21:10

ecraig12345