在Atom中禁用特定的linter规则(对于js-standard) [英] Disable a specific linter rule in Atom (for js-standard)
问题描述
我如何告诉Atom短绒机,特别是 js-standard ,规则?我希望它在整个项目范围内都被忽略,我认为我可以使用package.json或.eslintrc来实现,但是我都无法正常工作.我要禁用的规则是 camelcase
How do I tell an Atom linter, specifically js-standard, to ignore a rule? I want it ignored project-wide, and I thought that I could achieve this with a package.json or a .eslintrc but I can't get either to work. The rule I want to disable is camelcase
我应该能够在package.json文件中执行此操作,因为 js-standard linter有一个名为honorStyleSettings
的选项:
I should be able to do this in a package.json file, because the js-standard linter has an option called honorStyleSettings
:
在package.json中定义的荣誉样式设置.
Honors style settings defined in package.json.
支持的当前样式设置:
忽略
解析器
ignore
parser
这些设置的语法是什么?
What's the syntax of these settings?
推荐答案
为便于记录,以下是在Atom中使用js-standard并有选择地禁用特定规则的方法.
For the record, here's how to use js-standard in Atom while selectively disabling a certain rule.
- 禁用linter-js-standard atom软件包
- 安装linter-eslint
-
添加
.eslintrc
文件:
{
"extends": ["standard"],
"rules": {
"camelcase": 0
}
}
如果尚未安装standard和eslint,则可能还需要通过npm安装.
You may also need to install standard and eslint via npm, if you don't have them already.
这篇关于在Atom中禁用特定的linter规则(对于js-standard)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!