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

fix(perfectionist/sort-enums): sort numerically when possible #214

Conversation

sasial-dev
Copy link
Contributor

If an enum/const enum has numerical values they should sort in numerical order of the values instead of alphabetical names.

E.g.

export enum EngineerCertificationLevel {
	NotCertified = 0,
	EN101 = 101,
	EN102 = 102,
	EN103 = 103,
	EN204 = 204,
}

instead of

export enum EngineerCertificationLevel {
	EN101 = 101,
	EN102 = 102,
	EN103 = 103,
	EN204 = 204,
	NotCertified = 0,
}

This does not affect enums that do not have numerical values

Copy link

netlify bot commented Nov 17, 2024

Deploy Preview for beamish-daffodil-b0f61d ready!

Name Link
🔨 Latest commit f7425e3
🔍 Latest deploy log https://app.netlify.com/sites/beamish-daffodil-b0f61d/deploys/6739781d4f29d90008223905
😎 Deploy Preview https://deploy-preview-214--beamish-daffodil-b0f61d.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@christopher-buss christopher-buss merged commit 996c4ef into christopher-buss:main Dec 4, 2024
8 checks passed
@sasial-dev sasial-dev deleted the perfectionist/sort-enums/sort-numerically branch December 4, 2024 22:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants