[comma-dangle] does not check enum declarations #710
Labels
enhancement: new base rule extension
New base rule extension required to handle a TS specific case
good first issue
Good for newcomers
has pr
there is a PR raised to close this
package: eslint-plugin
Issues related to @typescript-eslint/eslint-plugin
Repro
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 forenums
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
@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
The text was updated successfully, but these errors were encountered: