如何从tslint中排除文件夹? [英] How to exclude a folder from tslint?

查看:581
本文介绍了如何从tslint中排除文件夹?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在vscode中排除使用tslint的test文件夹形式.因此,我已将排除对象放入tslint.json配置文件中.不幸的是,排除语句不起作用.有人知道如何设置排除吗?

I like to exclude the test folder form linting with tslint in vscode. So I have placed an exclude into my tslint.json config file. Unfortunately the exclude statement is not working. Does any one know how to set the exclude up?

 {
    "exclude": "tests/**/*.ts",
    "rulesDirectory": ["node_modules/tslint-microsoft-contrib"],
    "rules": {
        "export-name": true,
        ...
     }
}

推荐答案

似乎这是一个开放功能请求. 可以在这里找到更多信息: https://github.com/palantir/tslint/issues/73

It seems that this is an open feature request. Further information can be found here: https://github.com/palantir/tslint/issues/73

更新: 对于使用tslint作为编辑器/lint的VSCode的用户,可以将以下内容添加到VSCode配置中:

Update: for those who use VSCode with tslint as editor/linting you can add the following to the VSCode config:

 // Configure glob patterns of file paths to exclude from linting
"tslint.exclude": "**/PATH_eg_TESTS/**/*.ts"

这篇关于如何从tslint中排除文件夹?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆