Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rule Proposal: sort-keys #6076

Closed
mysticatea opened this issue May 4, 2016 · 7 comments
Closed

Rule Proposal: sort-keys #6076

mysticatea opened this issue May 4, 2016 · 7 comments
Assignees
Labels
accepted There is consensus among the team that this change meets the criteria for inclusion archived due to age This issue has been archived; please open a new issue for any further discussion feature This change adds a new feature to ESLint rule Relates to ESLint's core rules

Comments

@mysticatea
Copy link
Member

From validateOrderInObjectKeys.

This rule will enforce the order of object properties by their names.

{
    "sort-keys": [
        "error",
        "asc" or "desc",
        {
            "insensitive": false,
            "natural": false
        }
    ]
}
  • "asc" (default) - Requires sorting in ascending order.
  • "desc" - Requires sorting in descending order.
  • insensitive" (default is false) - If this is true, this rule compares keys in case-insensitive.
  • natural" (default is false) - If this is true, this rule compares keys in natural order.
@mysticatea mysticatea added rule Relates to ESLint's core rules feature This change adds a new feature to ESLint evaluating The team will evaluate this issue to decide whether it meets the criteria for inclusion labels May 4, 2016
@mysticatea mysticatea added this to the JSCS Compatibility milestone May 4, 2016
@jedwards1211
Copy link
Contributor

Note that some major libraries (e.g. React's transition group) rely on the de-facto preservation of object property ordering.

@platinumazure
Copy link
Member

@jedwards1211 Of course, those folks don't need to turn on this rule. 😄

@jacobrask
Copy link

For reference, see this plugin https://github.com/jacobrask/eslint-plugin-sorting

@ilyavolodin
Copy link
Member

I'll support it, 👍

@btmills
Copy link
Member

btmills commented Jul 19, 2016

The proposed options make sense to me. 👍

@nzakas
Copy link
Member

nzakas commented Jul 21, 2016

Per TSC meeting (7/21/16), marking as accepted.

@nzakas nzakas added accepted There is consensus among the team that this change meets the criteria for inclusion and removed evaluating The team will evaluate this issue to decide whether it meets the criteria for inclusion labels Jul 21, 2016
@mysticatea
Copy link
Member Author

I will work on this.

@mysticatea mysticatea self-assigned this Jul 23, 2016
mysticatea added a commit that referenced this issue Jul 25, 2016
mysticatea added a commit that referenced this issue Jul 30, 2016
mysticatea added a commit that referenced this issue Jul 30, 2016
mysticatea added a commit that referenced this issue Aug 9, 2016
mysticatea added a commit that referenced this issue Aug 11, 2016
nzakas pushed a commit that referenced this issue Aug 11, 2016
@eslint-deprecated eslint-deprecated bot locked and limited conversation to collaborators Feb 6, 2018
@eslint-deprecated eslint-deprecated bot added the archived due to age This issue has been archived; please open a new issue for any further discussion label Feb 6, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
accepted There is consensus among the team that this change meets the criteria for inclusion archived due to age This issue has been archived; please open a new issue for any further discussion feature This change adds a new feature to ESLint rule Relates to ESLint's core rules
Projects
No open projects
Development

No branches or pull requests

7 participants