Skip to content

Commit 49013fc

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 6205e29 commit 49013fc

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
@@ -95,7 +95,13 @@ module.exports = {
9595
ignorePattern: '.*',
9696
},
9797
}],
98-
'comma-dangle': ['error', 'only-multiline'],
98+
'comma-dangle': ['error', {
99+
arrays: 'always-multiline',
100+
exports: 'only-multiline',
101+
functions: 'only-multiline',
102+
imports: 'only-multiline',
103+
objects: 'only-multiline',
104+
}],
99105
'comma-spacing': 'error',
100106
'comma-style': 'error',
101107
'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)