feat(eslint-config): add comma-dangle rule

This commit is contained in:
陈嘉涵 2020-01-19 10:59:41 +08:00
parent 8b49c5ec36
commit 27c229d733

View File

@ -5,7 +5,7 @@ module.exports = {
parser: '@typescript-eslint/parser', parser: '@typescript-eslint/parser',
ecmaVersion: 2018, ecmaVersion: 2018,
sourceType: 'module', sourceType: 'module',
extraFileExtensions: ['.vue'] extraFileExtensions: ['.vue'],
}, },
plugins: ['@typescript-eslint'], plugins: ['@typescript-eslint'],
@ -14,13 +14,13 @@ module.exports = {
es6: true, es6: true,
node: true, node: true,
jest: true, jest: true,
browser: true browser: true,
}, },
globals: { globals: {
window: false, window: false,
document: false, document: false,
navigator: false navigator: false,
}, },
rules: { rules: {
@ -32,8 +32,17 @@ module.exports = {
'no-console': 0, 'no-console': 0,
'no-plusplus': 0, 'no-plusplus': 0,
'arrow-parens': 0, 'arrow-parens': 0,
'comma-dangle': 0,
'default-case': 0, 'default-case': 0,
'comma-dangle': [
'error',
{
arrays: 'always-multiline',
objects: 'always-multiline',
imports: 'always-multiline',
exports: 'always-multiline',
functions: 'never',
},
],
'prefer-template': 0, 'prefer-template': 0,
'consistent-return': 0, 'consistent-return': 0,
'no-param-reassign': 0, 'no-param-reassign': 0,
@ -64,6 +73,6 @@ module.exports = {
'vue/name-property-casing': ['error', 'kebab-case'], 'vue/name-property-casing': ['error', 'kebab-case'],
'vue/component-name-in-template-casing': ['error', 'kebab-case'], 'vue/component-name-in-template-casing': ['error', 'kebab-case'],
'vue/html-closing-bracket-newline': 2, 'vue/html-closing-bracket-newline': 2,
'@typescript-eslint/no-unused-vars': ['error'] '@typescript-eslint/no-unused-vars': ['error'],
} },
}; };