我有一个简单的数组定义,我希望它采用以下语法:
this.selfClosingHtmlTags = [
'area', 'base', 'br', 'col', 'command', 'embed',
'hr', 'img', 'input', 'keygen', 'link', 'meta', 'param', 'source', 'track',
'wbr'
]
当我保存文件时,Eslint 每行放一个项目:
this.selfClosingHtmlTags = [
'area',
'base',
'br',
'col',
'command',
'embed',
'hr',
'img',
'input',
'keygen',
'link',
'meta',
'param',
'source',
'track',
'wbr'
];
这是我当前的 eslint 配置:
{
"extends": ["fbjs"],
"rules": {
"comma-style": ["error", "last"],
"comma-dangle": ["error", "never"],
"consistent-return": 0,
"curly": ["error", "multi-line"],
"indent": ["error", 2, {
"CallExpression": {
"arguments": "first"
},
"SwitchCase": 1,
"ArrayExpression": "first"
}]
}
}