Skip to content
This repository was archived by the owner on May 12, 2025. It is now read-only.

Commit 50785b8

Browse files
authored
feat: improve comma-dangle rule for TypeScript files (#155)
1 parent c24836b commit 50785b8

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

lib/shared.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,14 @@ module.exports = {
5353

5454
// Replace Airbnb 'comma-dangle' rule with '@typescript-eslint' version
5555
// https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/comma-dangle.md
56+
// The TypeScript version also adds 3 new options, all of which should be set to the same value as the base config
5657
'comma-dangle': 'off',
57-
'@typescript-eslint/comma-dangle': baseStyleRules['comma-dangle'],
58+
'@typescript-eslint/comma-dangle': [baseStyleRules['comma-dangle'][0], {
59+
...baseStyleRules['comma-dangle'][1],
60+
enums: baseStyleRules['comma-dangle'][1].arrays,
61+
generics: baseStyleRules['comma-dangle'][1].arrays,
62+
tuples: baseStyleRules['comma-dangle'][1].arrays,
63+
}],
5864

5965
// Replace Airbnb 'comma-spacing' rule with '@typescript-eslint' version
6066
// https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/comma-spacing.md

0 commit comments

Comments
 (0)