Javascript Adobe Brackets 禁用 jslint 但允许 jshint
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/27584301/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Adobe Brackets disable jslint but allow jshint
提问by rg88
My basic question:In the Adobe Brackets editor how do I use jshint while turning off or disabling jslint?
我的基本问题:在 Adobe Brackets 编辑器中,如何在关闭或禁用 jslint 的同时使用 jshint?
My tl;dr:When linting javascript in the Adobe Brackets editor I find that I get results for both jslint and jshint. While I have jshint configured to my liking I can never avoid the warning symbol that appears indicating I have failed to pass jslint so it always looks like there are problems with my linting. I only want to use jshint as the ability to globally configure it via the .jshintrc file is quite useful but I don't see a way to turn off jslint and still permit jshint. Anyone know how to do this?
我的 tl;dr:在 Adobe Brackets 编辑器中对 javascript 进行 linting 时,我发现我得到了 jslint 和 jshint 的结果。虽然我根据自己的喜好配置了 jshint,但我永远无法避免出现的警告符号,表明我未能通过 jslint,因此看起来我的 linting 总是有问题。我只想使用 jshint,因为通过 .jshintrc 文件全局配置它的能力非常有用,但我没有看到关闭 jslint 并仍然允许 jshint 的方法。有人知道怎么做吗?
I suppose I could dump jshint and just use jslint but since the latter requires the configuration to be stuck directly in the JS file I don't want to do this.
我想我可以转储 jshint 并只使用 jslint 但由于后者需要将配置直接卡在 JS 文件中,我不想这样做。
回答by David Lane
You can now add your preferred linters to Brackets' preferences file:
您现在可以将首选的 linter 添加到 Brackets 的首选项文件中:
"language": {
"javascript": {
"linting.prefer": ["JSHint"],
"linting.usePreferredOnly": true
}
},
Open the preferences file with Debug > Open Preferences File.
使用Debug > Open Preferences File.打开首选项文件。
回答by Helzgate
To have multiple linters while still disabling jslint use the above plus this:
要在仍然禁用 jslint 的同时使用多个 linter,请使用上面的加上这个:
"linting.prefer": [
"JSHint",
"JSCS"
],
回答by Shubhra
In the Brackets IDE, select File -> Extension Manager. Click the Default tab and look for JSLint in the search box and disable it.
在 Brackets IDE 中,选择 File -> Extension Manager。单击默认选项卡并在搜索框中查找 JSLint 并禁用它。
Brackets version - 1.10
括号版本 - 1.10
回答by ashkan nasirzadeh
1- go to menu-->Debug
2- go to "open Preferences File"
3- go to the file : "brackets.json"
4- copy and pase these codes on last line and dont forget separate code lines with ",":
1- 转到菜单-->调试
2- 转到“打开首选项文件”
3- 转到文件:“brackets.json”
4- 将这些代码复制并粘贴到最后一行,不要忘记用“,”分隔的代码行:
"linting.prefer": ["JSHint"],
"linting.usePreferredOnly": true
*HOPE TO HELP :))
*希望能帮到你:))
回答by rg88
So the short answer is "you can't".
所以简短的回答是“你不能”。
After much digging around it seems that while you can turn off jslint, that will also turn off jshint. Since jslint is baked in to Brackets the only solution is to go in and hack the code Brackets yourself. C'est la vie.
经过大量挖掘后,似乎虽然您可以关闭 jslint,但也将关闭 jshint。由于 jslint 已融入到 Brackets 中,唯一的解决方案是自己进入并破解代码 Brackets。这就是生活。

