Skip to content

Commit

Permalink
tools: make comma-dangle ESLint rule more stringent …
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Trott authored and targos committed Sep 4, 2021
1 parent d56e826 commit 315eba7
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
8 changes: 7 additions & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,13 @@ module.exports = {
ignorePattern: '.*',
},
}],
'comma-dangle': ['error', 'only-multiline'],
'comma-dangle': ['error', {
arrays: 'always-multiline',
exports: 'only-multiline',
functions: 'only-multiline',
imports: 'only-multiline',
objects: 'only-multiline',
}],
'comma-spacing': 'error',
'comma-style': 'error',
'computed-property-spacing': 'error',
Expand Down
2 changes: 2 additions & 0 deletions test/.eslintrc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ env:
es6: true

rules:
# For now, comma-dangle is more lenient in the test directory than elsewhere.
comma-dangle: ["error", "only-multiline"]
no-var: error
prefer-const: error
symbol-description: off
Expand Down

0 comments on commit 315eba7

Please sign in to comment.