Sort imports#1283
Open
remcohaszing wants to merge 1 commit into
Open
Conversation
Contributor
Author
|
The failing check does not fail for me locally. Maybe look at the related PRs before considering this change. Then I’ll rebase if those are accepted. |
82bd2aa to
03f7889
Compare
Contributor
Author
|
Note that this change is purely stylistic. |
ce71e43 to
f67897a
Compare
This change enforces some ESLint rules to ensure consistent import sorting. The `import-x/first` rule ensures all imports are on top of the file. The `import-x/order` rule forces a consistent order of import statements. Imports are grouped by Node.js builtins, external dependencies, and relative imports. Type imports are sorted before values. Within each group, the statements are alphabetized. The `sort-imports` rule sorts the imported members. The `import/newline-after-import` rule enforces a newline after the last import.
f67897a to
eefe7cb
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
This change enforces some ESLint rules to ensure consistent import sorting. In my experience this helps identifying how imports, files, and dependencies are used.
The
import-x/firstrule ensures all imports are on top of the file.The
import-x/orderrule forces a consistent order of import statements. Imports are grouped by Node.js builtins, external dependencies, and relative imports. Type imports are sorted before values. Within each group, the statements are alphabetized.The
sort-importsrule sorts the imported members.The
import/newline-after-importrule enforces a newline after the last import.What issues does this PR fix or reference?
This is built on top of #1282
Is it tested? How?