简体   繁体   中英

WebStorm disable TSLint of js files

I'm using WebStorm 2019.1

I've generated a project using the Angular CLI.

Everything works fine but I have one or two .js files in my project - eg protractor.conf.js

Within the IDE, TSLint is linting the .js files and showing loads of red. But I don't want TSLint to lint the .js files.

I know I could disable TSLint for this file but I'd rather configure my project correctly by doing this via tsconfig.json or tslint.json or if all else fails via WebStorm settings.

在此处输入图片说明

I've tried "tslint.jsEnable": false as described here - https://github.com/Microsoft/vscode-tslint/issues/261 - but I think this is for a different IDE. Any ideas how to do this via tsconfig.json or tslint.json or failing that via WebStorm settings?

Since 2019.1 .js files are linted if jsRules is present in tslint.json ( WEB-36890 ). You can add .js files to "exclude": option in tslint.json if you don't want them to be linted:

"linterOptions": {
    "exclude": ["**/*.js"]
}

This change will be reverted in 2019.1.1 - there will be the checkbox that existed in previous versions - Process JS files , off by default

正如@lena所说的那样,它将在2019.1.1中修复( WEB-38096

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