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

[ADD] eslint-plugin-perfectionist #194

Open
lishaduck opened this issue Aug 8, 2024 · 4 comments
Open

[ADD] eslint-plugin-perfectionist #194

lishaduck opened this issue Aug 8, 2024 · 4 comments
Labels
plugins triaging Issue is still being evaluated. PRs not yet accepted.

Comments

@lishaduck
Copy link
Contributor

lishaduck commented Aug 8, 2024

Sorts stuff-keeping stuff consistent is nice, but it also helps performance (very slightly), as objects in a different order aren't optimized by the JIT, and I don't believe any bundlers sort keys, though I'd be happy to be proven wrong.

It could also replace eslint-simple-import-sort.

Link: https://perfectionist.dev/

I know I can add it manually, but I'd prefer to see if @AndreaPontrandolfo supports the idea, as putting it in sheriff helps provide a better experience for all.
I'd be willing to PR this, likely next week.

@lishaduck lishaduck changed the title [ADD] Perfectionist [ADD] eslint-plugin-perfectionist Aug 8, 2024
@AndreaPontrandolfo AndreaPontrandolfo added the triaging Issue is still being evaluated. PRs not yet accepted. label Aug 17, 2024
@AndreaPontrandolfo
Copy link
Owner

AndreaPontrandolfo commented Aug 19, 2024

Well, there are a lot of pros and lot of cons.

PROS

  • consistency
  • predicatibility
  • more stable git diffs

CONS

  • it's a very minor nitpick, people might get annoyed at the warnings (even though most of these probably autofix)
  • very high chance to conflict with other rules that mess with ordering with different principles
  • performance cost. These rules would have a pretty noticeable impact on editors performance

but it also helps performance (very slightly), as objects in a different order aren't optimized by the JIT, and I don't believe any bundlers sort keys, though I'd be happy to be proven wrong.

I wouldn't even list this as a PRO, to be honest, these sort of perf optimizations are usually negligible in the real world.

Also has to be said that ESLint has a core rule for object keys ordering. But it doesn't even autofix, so it's pretty bad.

@lishaduck
Copy link
Contributor Author

lishaduck commented Aug 19, 2024

Well, there are a lot of pros and lot of cons.

Yep.

CONS

  • it's a very minor nitpick, people might get annoyed at the warnings (even though most of these probably autofix)
  • very high chance to conflict with other rules that mess with ordering with different principles

...
Also has to be said that ESLint has a core rule for object keys ordering. But it doesn't even autofix, so it's pretty bad.

True enough, but they're getting deprecated in favor of perfectionist.

  • performance cost. These rules would have a pretty noticeable impact on editors performance

Yeah, that's probably worth considering.

but it also helps performance (very slightly), as objects in a different order aren't optimized by the JIT, and I don't believe any bundlers sort keys, though I'd be happy to be proven wrong.

I wouldn't even list this as a PRO, to be honest, these sort of perf optimizations are usually negligible in the real world.

Yeah. I don't think it makes a real difference, but it's not a negative.

@AndreaPontrandolfo
Copy link
Owner

True enough, but they're getting deprecated in favor of perfectionist.

Where did you see this?

@lishaduck
Copy link
Contributor Author

True enough, but they're getting deprecated in favor of perfectionist.

Where did you see this?

https://typescript-eslint.io/rules/sort-type-constituents/, and I thought there was some discussion in the eslint org with the stylistic migration, though a quick search doesn't pop it up.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
plugins triaging Issue is still being evaluated. PRs not yet accepted.
Projects
None yet
Development

No branches or pull requests

2 participants