问题描述
我如何告诉 Atom linter,特别是 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 中定义的样式设置.
支持的当前样式设置:
忽略
解析器
这些设置的语法是什么?
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
}
}
你可能还需要通过 npm
安装 standard
和 eslint
,如果你还没有的话.
You may also need to install standard
and eslint
via npm
, if you don't have them already.
这篇关于在 Atom 中禁用特定的 linter 规则(对于 js 标准)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!