Skip to content

Sort imports#1283

Open
remcohaszing wants to merge 1 commit into
redhat-developer:mainfrom
remcohaszing:sort-imports
Open

Sort imports#1283
remcohaszing wants to merge 1 commit into
redhat-developer:mainfrom
remcohaszing:sort-imports

Conversation

@remcohaszing

@remcohaszing remcohaszing commented Jun 13, 2026

Copy link
Copy Markdown
Contributor

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/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.

What issues does this PR fix or reference?

This is built on top of #1282

Is it tested? How?

eslint
tsc

@remcohaszing remcohaszing requested a review from datho7561 as a code owner June 13, 2026 10:00
@remcohaszing

Copy link
Copy Markdown
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.

@remcohaszing

Copy link
Copy Markdown
Contributor Author

Note that this change is purely stylistic.

@remcohaszing remcohaszing force-pushed the sort-imports branch 2 times, most recently from ce71e43 to f67897a Compare June 24, 2026 07:50
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.
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.

1 participant