-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Description
Repro
{
"rules": {
"comma-dangle": ["error", "always-multiline"]
}
}
enum MyEnum {
MY_VALUE,
MY_OTHER_VALUE
}
Expected Result
Some kind of error on line three of the test file, since there is no trailing comma after the final enum member.
Actual Result
No error is reported.
Additional Info
Ideally, this would happen with no extra config, where typescript-eslint would somehow “plug into” eslint’s comma-dangle rule. That said, its current implementation doesn’t look like it invites this; for example, it immediately throws away option members other than arrays
/objects
/imports
/exports
/functions
, so it’s not clear how typescript-eslint could have separate options for enums
here. A separate, TypeScript-specific rule seems more likely (I’m not sure if there are any other syntax constructs besides enums that support dangling commas). In that case, of course, the separate rule would need to be mentioned in the repro to make it work – but I couldn’t find any existing rule that would provide this.
Versions
package | version |
---|---|
@typescript-eslint/eslint-plugin |
1.12.0 |
@typescript-eslint/parser |
1.12.0 |
TypeScript |
3.5.3 |
ESLint |
6.0.1 |
node |
12.6.0 |
npm |
6.9.0 |