本文介绍了如何忽略tslint的特定目录或文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
正在使用的IDE是WebStorm 11.0.3,tslint已配置并可正常工作,但由于它尝试解析大型* .d.ts库文件而挂起。
The IDE being used is WebStorm 11.0.3, the tslint is configured and works, but, it hangs because it tries to parse large *.d.ts library files.
有没有办法忽略特定的文件或目录?
Is there a way to ignore a particular file or directory?
推荐答案
使用进行更新
如所述,您现在可以更新 tslint.json CLI选项:
As was mentioned by Saugat Acharya you can now update tslint.json CLI Options:
{
"extends": "tslint:latest",
"linterOptions": {
"exclude": [
"bin",
"lib/*generated.js"
]
}
}
更多信息
此功能已随
tslint \"src/**/*.ts\" -e \"**/__test__/**\"
您现在可以添加--exclude(或-e)参见。
You can now add --exclude (or -e) see PR here.
CLI
enter code here 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
您正在使用
-e, --exclude exclude globs from path expansion
这篇关于如何忽略tslint的特定目录或文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!