简体   繁体   English

.jscsrc / .jshintrc中的jscs和jshint是否可以关闭目录的lint选项?

[英]Is there an option for jscs and jshint in .jscsrc/.jshintrc to turn off linting for a directory?

I would like to disable linting for all files in a directory 我想禁用目录中所有文件的掉毛

For example 例如

/
 some.js <-LINT
 noLint
   file1.js <- NO LINT
   file2.js <- NO LINT
   subDir
     file3.js <- NO LINT

I don't think that is possible. 我认为那是不可能的。 For jscs, I can imagine you can create a jscsrc that effectively disables all default rules. 对于jscs,我可以想象您可以创建一个有效禁用所有默认规则的jscsrc。 For example: 例如:

{
    "validateLineBreaks": false,
    "disallowMultipleVarDecl": false,
    "validateIndentation": null
}

For jshint, you can try something similar: 对于jshint,您可以尝试类似的方法:

{
    "browser": true,
    "jquery": true,
    "mocha": true,
    "node": true,

    "curly": false,
    "eqeqeq": false,
    "maxdepth": 99,
    "maxerr": 1000,
    "undef": false,
    "unused": false,
    "esversion": 6,
    "expr": true
}

So instead of disabling, you create settings that are as loose as possible. 因此,您不必禁用设置,而是创建尽可能宽松的设置。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM