Skip to content

Linters should support sort keys in js files #41767

@MrJithil

Description

@MrJithil

What is the problem this feature will solve?

Currently, the object keys need manual verification to ensure all the keys are in sort order.

Eg: const { z, y, x} = alphabets; should be sorted as const { x,y,z } = alphabets;.

Devs may miss to sort it.

What is the feature you are proposing to solve the problem?

Object key sorting could be enforced using the ESLint rule. This could be done using the rule https://eslint.org/docs/rules/sort-keys

What alternatives have you considered?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    feature requestIssues that request new features to be added to Node.js.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions