简体   繁体   中英

TSLint and VSCode not showing red-line in .ts file

I have a single .ts file where i am learning to configure tslint and tsconfig. I have induced extra spaces and removed semi-colon intentionally to check if tslint is configured properly.

Using command tslint filename.ts i could see tslint could find errors in .ts file but VSCode is not showing those red lines ?

I have generated tslint.json and tsconfig.json using CLI: tslint --init,tsc --init

无红线

But in angular-app it shows

红线

What am i missing? I went to through tslint and tsconfig docs, couldn't find how to configure.

how to get red-line in normal ts-files? Thanks in advance

Finally found the solution. Its basically TSLint extension issue not TSLint CLI itself. The extension need tslint and typescript in node_modules for it to work. So i added package.json

{
  "devDependencies": {
    "typescript": "^3.2.1",
    "tslint": "5.11.0"
  }
}

and ran npm install . Restarted VSCode. I got those red-lines back. :-)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM