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.
  • Loading branch information
Trott committed Feb 6, 2021
1 parent 1112ce7 commit 14678f2
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 @@ -94,7 +94,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 14678f2

Please sign in to comment.