Skip to content

Add allowLineSeparatedGroups option to sort-keys rule #12759

@nicogreenarry

Description

@nicogreenarry

What 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.

Metadata

Metadata

Assignees

Labels

acceptedThere is consensus among the team that this change meets the criteria for inclusionarchived due to ageThis issue has been archived; please open a new issue for any further discussionenhancementThis change enhances an existing feature of ESLintruleRelates to ESLint's core rules

Type

No type

Projects

Status

Complete

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions