Skip to content

Commit 14678f2

Browse files
committed
tools: make comma-dangle ESLint rule more stringent …
We've been having a lot of nits lately asking people to add trailing commas, so it's probably time to incrementally make the comma-dangle rule more stringent.
1 parent 1112ce7 commit 14678f2

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

.eslintrc.js

+7-1
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,13 @@ module.exports = {
9494
ignorePattern: '.*',
9595
},
9696
}],
97-
'comma-dangle': ['error', 'only-multiline'],
97+
'comma-dangle': ['error', {
98+
arrays: 'always-multiline',
99+
exports: 'only-multiline',
100+
functions: 'only-multiline',
101+
imports: 'only-multiline',
102+
objects: 'only-multiline',
103+
}],
98104
'comma-spacing': 'error',
99105
'comma-style': 'error',
100106
'computed-property-spacing': 'error',

test/.eslintrc.yaml

+2
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ env:
55
es6: true
66

77
rules:
8+
# For now, comma-dangle is more lenient in the test directory than elsewhere.
9+
comma-dangle: ["error", "only-multiline"]
810
no-var: error
911
prefer-const: error
1012
symbol-description: off

0 commit comments

Comments
 (0)