Skip to content

Commit a8b58e9

Browse files
committed
Ignoring the trailing comma rule for function parameter. Ignoring a not disallowing it because once node will support it, we’re going to want to have it.
1 parent 423104e commit a8b58e9

File tree

3 files changed

+18
-1
lines changed

3 files changed

+18
-1
lines changed

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
11
.idea/
2-
32
npm-debug.log

packages/eslint-config-transit/index.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,12 @@ module.exports = {
1212
'max-len': ['error', 105, 2],
1313
'no-param-reassign': 'off',
1414
'no-use-before-define': 'off',
15+
'comma-dangle': ['error', {
16+
arrays: 'always-multiline',
17+
objects: 'always-multiline',
18+
imports: 'always-multiline',
19+
exports: 'always-multiline',
20+
functions: 'ignore',
21+
}],
1522
},
1623
};

packages/eslint-config-transit/test/eslint-config-transit-test.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,3 +33,14 @@ if (reassignParameter) {
3333
else {
3434
functionDefinedBeforeUse();
3535
}
36+
37+
// Trailing comma in function parameters should be ignored
38+
// It's a ES2017 features and it's not available in any Node JS version.
39+
function testMyTrailingComma(
40+
a,
41+
b
42+
) {
43+
return a + b;
44+
}
45+
46+
testMyTrailingComma();

0 commit comments

Comments
 (0)