【发布时间】:2019-03-14 01:21:28
【问题描述】:
我们正在使用一个非常简单的 .eslintrc.json 文件,但我无法弄清楚我的 IDE 自动执行的操作但随后 ESlint 抱怨的方式。
我想对齐下面的等号
let foo = {}
foo.one = 1
foo.oneHundred = 100
而不是:
let foo = {}
foo.one = 1
foo.oneHundred = 100
这是eslint 文件。
{
"extends": "standard",
"env": {
"es6": true,
"node": true,
"mocha": true
},
"rules": {
"indent": ["error", 4, { "SwitchCase": 1 }],
"quotes": ["error", "single", { "avoidEscape": true }],
"no-multi-spaces": ["error", { "exceptions": { "ImportDeclaration": false, "VariableDeclarator": true } }]
}
}
请帮忙。 ;-)
【问题讨论】:
-
It doesn't seem like there's a core ESLint rule for that,因为它不是 JS 世界的流行标准(不幸的是)。有人将不得不编写一个自定义插件来做到这一点。
标签: javascript node.js eslint eslintrc