How to ignore a particular directory or file for tslint?(如何忽略 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 v5.8.0
正如 Saugat Acharya 所述,您现在可以更新 tslint.json CLI 选项:
As mentioned by Saugat Acharya, you can now update tslint.json CLI Options:
{
"extends": "tslint:latest",
"linterOptions": {
"exclude": [
"bin",
"lib/*generated.js"
]
}
}
更多信息在这个拉取请求中.
此功能已在 tslint 3.6 中引入
tslint "src/**/*.ts" -e "**/__test__/**"
您现在可以在此处添加 --exclude(或 -e)参见 PR.
You can now add --exclude (or -e) see PR here.
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
你正在考虑使用
-e, --exclude exclude globs from path expansion
这篇关于如何忽略 tslint 的特定目录或文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:如何忽略 tslint 的特定目录或文件?
基础教程推荐
- Javascript 在多个元素上单击事件侦听器并获取目标 2022-01-01
- 如何在特定日期之前获取消息? 2022-01-01
- jQuery File Upload - 如何识别所有文件何时上传 2022-01-01
- WatchKit 支持 html 吗?有没有像 UIWebview 这样的控制器? 2022-01-01
- 如何使用 CSS 显示和隐藏 div? 2022-01-01
- Node.js 有没有好的索引/搜索引擎? 2022-01-01
- 每次设置弹出窗口的焦点 2022-01-01
- 什么是不使用 jQuery 的经验技术原因? 2022-01-01
- 如何使用sencha Touch2在单页中显示列表和其他标签 2022-01-01
- 为什么我在 Vue.js 中得到 ERR_CONNECTION_TIMED_OUT? 2022-01-01
