Add `allowLineSeparatedGroups` option to `sort-keys` rule
See original GitHub issueWhat rule do you want to change? sort-keys
Does this change cause the rule to produce more or fewer warnings?
No changes, if the allowLineSeparatedGroups
parameter is false or omitted, or fewer warnings if it is true.
How will the change be implemented? (New option, new default behavior, etc.)?
Add a new allowLineSeparatedGroups
option, following the pattern of the tslint’s object-literal-sort-keys
rule.
Please provide some example code that this change will affect:
const person = {
firstName: 'Nico',
lastName: 'Greenarry',
hobbies: ['cats', 'dodgeball', 'potlucks'],
};
What does the rule currently do for this code?
ESLint: Expected object keys to be in ascending order. ‘hobbies’ should be before ‘lastName’. (sort-keys)
What will the rule do after it’s changed?
If the allowLineSeparatedGroups
option is true, then there would be no eslint exception.
Are you willing to submit a pull request to implement this change? Yes. I haven’t looked at the eslint codebase before, so I expect there to be a learning curve, but I’m willing to figure out how to implement it properly.
Issue Analytics
- State:
- Created 4 years ago
- Reactions:14
- Comments:9 (5 by maintainers)
Top GitHub Comments
@nicogreenarry In recent times I think we’ve trended towards longer, more explicit option names 😃 Do you mind updating the proposal with
allowLineSeparatedGroups
?@g-plane I’ll champion. We just need one more supporter.
Agree with the proposal too. @nicogreenarry If you don’t mind, can I work on this issue? I’m new here and I’m looking for something to contribute. 😄