use*_*840 113 javascript ide webstorm typescript tslint
正在使用的IDE是WebStorm 11.0.3,tslint已配置并可正常工作,但由于它尝试解析大型*.d.ts库文件而挂起.
有没有办法忽略特定的文件或目录?
Mic*_*ael 171
使用TSLINT v5.8.0更新
正如Saugat Acharya所提到的,您现在可以更新tslint.json CLI选项:
{
"extends": "tslint:latest",
"linterOptions": {
"exclude": [
"bin",
"lib/*generated.js"
]
}
}
Run Code Online (Sandbox Code Playgroud)
更多信息在这里
TSLINT 3.6引入了此功能
tslint \"src/**/*.ts\" -e \"**/__test__/**\"
Run Code Online (Sandbox Code Playgroud)
您现在可以在此处添加--exclude(或-e)查看PR.
CLI
usage: tslint [options] file ...
Options:
-c, --config configuration file
--force return status code 0 even if there are lint errors
-h, --help display detailed help
-i, --init generate a tslint.json config file in the current working directory
-o, --out output file
-r, --rules-dir rules directory
-s, --formatters-dir formatters directory
-e, --exclude exclude globs from path expansion
-t, --format output format (prose, json, verbose, pmd, msbuild, checkstyle) [default: "prose"]
--test test that tslint produces the correct output for the specified directory
-v, --version current version
Run Code Online (Sandbox Code Playgroud)
你正在寻找使用
-e, --exclude exclude globs from path expansion
Run Code Online (Sandbox Code Playgroud)
Dea*_*ers 43
我正在使用Visual Studio Code和this
/* tslint:disable */
为我工作.看看这个页面,大约3/4的路上有一些禁用命令https://c9.io/lijunle/tslint
ark*_*ise 26
除了迈克尔的答案,还要考虑第二种方法:将linterOptions.exclude添加到tslint.json
例如,您可能拥有tslint.json以下行:
{
"linterOptions": {
"exclude": [
"someDirectory/*.d.ts"
]
}
}
Run Code Online (Sandbox Code Playgroud)
Sau*_*rya 14
从tslint v5.8.0您开始,您可以在文件中exclude的linterOptions密钥下设置一个属性tslint.json:
{
"extends": "tslint:latest",
"linterOptions": {
"exclude": [
"bin",
"**/__test__",
"lib/*generated.js"
]
}
}
Run Code Online (Sandbox Code Playgroud)
更多信息请参见这里.
tec*_*000 10
我不得不使用 **/* 语法来排除文件夹中的文件:
"linterOptions": {
"exclude": [
"src/auto-generated/**/*",
"src/app/auto-generated/**/*"
]
},
Run Code Online (Sandbox Code Playgroud)
Alb*_*rtK 10
作为补充
禁用下一行的所有规则 // tslint:disable-next-line
要禁用下一行的特定规则:// tslint:disable-next-line:rule1 rule2...
要禁用当前行的所有规则:someCode(); // tslint:disable-line
要禁用当前行的特定规则:someCode(); // tslint:disable-line:rule1
| 归档时间: |
|
| 查看次数: |
77816 次 |
| 最近记录: |