-
Notifications
You must be signed in to change notification settings - Fork 1
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: import order rules #20
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
utACK
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would be great to have it integrated with prettier at some point as well as juggling imports manually will be annoying, thinking of alphabetic order in the head when organising your imports vs just having it work on save.
Those rules will only raise warnings, and will not auto fix ? Most of the import warnings I create are mostly because vscode auto-import the packages for me when I type a function, and it append them at the end. Would be good if we can just forgot about importing things |
These should be auto fixed with |
Summary:
Context: snapshot-labs/sx-monorepo#383 (comment)
Often we miss sorting imports, this should be automated with eslint rules
sort-imports
rule to sort imports inside one file/libimport/order
rule to sort imports in groups in order:['builtin', 'external', 'internal', 'type']
How to test:
eslintConfig
add config from this PR (add double quotes)['builtin', 'external', 'internal', 'type']
, see the error