Skip to content

Commit 315eba7

Browse files
Trotttargos
authored andcommitted
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. PR-URL: #37088 Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
1 parent d56e826 commit 315eba7

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
@@ -126,7 +126,13 @@ module.exports = {
126126
ignorePattern: '.*',
127127
},
128128
}],
129-
'comma-dangle': ['error', 'only-multiline'],
129+
'comma-dangle': ['error', {
130+
arrays: 'always-multiline',
131+
exports: 'only-multiline',
132+
functions: 'only-multiline',
133+
imports: 'only-multiline',
134+
objects: 'only-multiline',
135+
}],
130136
'comma-spacing': 'error',
131137
'comma-style': 'error',
132138
'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)