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

feat(linter): create the import/order rule #7903

Open
wants to merge 9 commits into
base: main
Choose a base branch
from

Conversation

Spoutnik97
Copy link
Contributor

all cases are not covered bu the architecture is setup

all cases are not covered bu the architecture is setup
Copy link

graphite-app bot commented Dec 14, 2024

How to use the Graphite Merge Queue

Add either label to this PR to merge it via the merge queue:

  • 0-merge - adds this PR to the back of the merge queue
  • hotfix - for urgent hot fixes, skip the queue and merge this PR next

You must have a Graphite account in order to use the merge queue. Sign up using this link.

An organization admin has enabled the Graphite Merge Queue in this repository.

Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue.

@github-actions github-actions bot added A-linter Area - Linter C-enhancement Category - New feature or request labels Dec 14, 2024
Copy link

codspeed-hq bot commented Dec 14, 2024

CodSpeed Performance Report

Merging #7903 will not alter performance

Comparing Spoutnik97:linter/order (391506f) with main (4727667)

Summary

✅ 29 untouched benchmarks

Copy link
Member

@Boshen Boshen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems like this is for https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/order.md and not https://eslint.org/docs/latest/rules/sort-imports

Biome also has a separate import sorting step https://biomejs.dev/analyzer/import-sorting/

I wonder what the differences are.

@Sysix
Copy link
Contributor

Sysix commented Dec 15, 2024

@Spoutnik97 thanks for the work 👍

It feels like you are going to the trouble of making your own file with tests. Please have a look how to setup a new rule:
https://oxc.rs/docs/contribute/linter/adding-rules.html

The just commands looks to be outdated🙃 . The listed commands can also be found here:
https://github.com/oxc-project/oxc/blob/main/justfile#L159-L199

@Spoutnik97
Copy link
Contributor Author

@Sysix oh great! Indeed I didn't know this refreshed list

@Spoutnik97
Copy link
Contributor Author

https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/order.md

@Boshen yes indeed, this is for this rule

It seems that differences are you cannot customize the order/groups with biomejs

Copy link
Contributor

@camc314 camc314 Dec 16, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i don't think this snap should be committed

@camc314
Copy link
Contributor

camc314 commented Dec 16, 2024

We've also got #7197 which we were considering implementing

I would suggest we perhaps make an issue for this with one rule (maybe oxc) to cover all/most cases? my reasoning for this is that we don't really want two rules doing almost the same thing

We cam probable remove a few of the config options from eslint-plugin-import to help it get shipped quicker and to avoid having to support incredibly complex configrations

@Spoutnik97
Copy link
Contributor Author

I just improved the rule by covering more use cases. Indeed, it would be better to don't have duplicate rule effects
I fixed tests and move to the right folders

@Spoutnik97
Copy link
Contributor Author

Performances issues are fixed.
All checks passed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-linter Area - Linter C-enhancement Category - New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants