-
-
Notifications
You must be signed in to change notification settings - Fork 5k
Add consistent option to comma-dangle #10350
Copy link
Copy link
Closed
Labels
archived due to ageThis issue has been archived; please open a new issue for any further discussionThis issue has been archived; please open a new issue for any further discussionauto closedThe bot closed this issueThe bot closed this issueenhancementThis change enhances an existing feature of ESLintThis change enhances an existing feature of ESLintevaluatingThe team will evaluate this issue to decide whether it meets the criteria for inclusionThe team will evaluate this issue to decide whether it meets the criteria for inclusionruleRelates to ESLint's core rulesRelates to ESLint's core rules
Metadata
Metadata
Assignees
Labels
archived due to ageThis issue has been archived; please open a new issue for any further discussionThis issue has been archived; please open a new issue for any further discussionauto closedThe bot closed this issueThe bot closed this issueenhancementThis change enhances an existing feature of ESLintThis change enhances an existing feature of ESLintevaluatingThe team will evaluate this issue to decide whether it meets the criteria for inclusionThe team will evaluate this issue to decide whether it meets the criteria for inclusionruleRelates to ESLint's core rulesRelates to ESLint's core rules
What rule do you want to change?
comma-dangle
Does this change cause the rule to produce more or fewer warnings?
That depends.
How will the change be implemented? (New option, new default behavior, etc.)?
This is a feature request from Node.js: it would be nice to add a
consistentoption tocomma-danglethat checks if the whole file has a consistent style of either always having trailing commas or having no trailing commas at all. With the current options something like this is not possible.Refs: nodejs/node#20703 (comment)
Please provide some example code that this change will affect:
What does the rule currently do for this code?
Using the
only-multilineoption results in no error. Using thealways-multilinealways reports errors.What will the rule do after it's changed?
It should report an issue as long as both styles are used in a single file. If the file has either a consistent trailing comma style or no trailing commas, it should not report an issue.