JSHint:覆盖整个文件夹的单个.jshintrc选项

我有一个.jshintrc在我的项目的根目录下面的configuration:

 { "node": true, "smarttabs": true, "undef": true, "unused": true } 

这对于我在项目中所有与节点相关的东西都是好的,但是对于浏览器相关的脚本来说并不是这样。 哪些坐在子文件夹中。
是否可以覆盖node选项,同时保留整个文件夹的其他选项?

如果我为浏览器端文件夹创build另一个.jshintrc文件,我必须再次告诉JSHint关于我所有的configuration,虽然我实际上只想取消设置node选项。

我知道我可以在每个文件中设置这个选项,但我实际上想避免这种情况。

提前谢谢了!

是的, jshint v2.5.1中的一个特性是“扩展”,对于您的示例,这可能是这样的:

/.jshintrc

 { "smarttabs": true, "undef": true, "unused": true } 

/server/.jshintrc

 { "extends": "../.jshintrc", "node": true } 

/client/.jshintrc

 { "extends": "../.jshintrc", "browser": true } 

你可以在这里阅读更多关于这个function: https : //github.com/jshint/jshint/releases/tag/2.5.1