Inconsistent import ordering is a low-stakes signal with a real cost: it generates unnecessary merge conflicts when two developers touch the same file, and it slows down code review because readers must mentally parse which dependencies are third-party versus internal. ISO 25010 maintainability.analysability degrades when every file has a different ordering convention. Projects assembled across multiple AI sessions are especially prone to this because each session may apply a different implicit convention.
Low because inconsistent imports cause friction and merge conflicts but do not break functionality or introduce security risk.
Let tooling enforce ordering automatically so no human has to think about it. Add the import/order rule to your ESLint config:
"import/order": ["warn", {
"groups": ["builtin", "external", "internal", "parent", "sibling", "index"]
}]
Alternatively, configure @trivago/prettier-plugin-sort-imports. Run once across the codebase to reformat all existing files, then every future file auto-conforms on save.
ID: code-maintainability.code-organization.import-organization
Severity: low
What to look for: Examine import blocks at the top of 5-10 representative source files. Check whether imports are organized in a consistent order. Common conventions are: external packages first, then internal absolute imports, then relative imports; or alphabetically within groups; or following the configured import/order ESLint rule. Look for: mixed ordering with no discernible pattern, third-party and relative imports interleaved, type imports scattered throughout rather than grouped.
Pass criteria: Count all source files with at least 3 imports and examine at least 5 representative files. Import ordering follows a consistent pattern across at least 80% of examined files. Either an ESLint import/order rule is configured that enforces the order, or 80%+ of examined files follow the same informal convention. Report the ratio: "X of Y examined files follow consistent import ordering."
Fail criteria: Imports are in inconsistent or random order in the majority of files examined, and no linting rule enforces order.
Cross-reference: For directory structure conventions that affect import paths, see the file-folder-structure check in this audit.
Skip (N/A) when: The project has fewer than 5 source files with multiple imports. Signal: project has fewer than 5 source files.
Detail on fail: "Import ordering is inconsistent across components — third-party, internal, and relative imports are mixed without a discernible pattern. No import/order ESLint rule configured."
Remediation: Consistent import ordering reduces merge conflicts and makes it easy to scan which dependencies a file uses. The easiest fix is to let tooling handle it automatically:
# Add to your ESLint config:
# "import/order": ["warn", { "groups": ["builtin", "external", "internal", "parent", "sibling", "index"] }]
Or configure Prettier with @trivago/prettier-plugin-sort-imports. Once configured, run it once across the codebase and all future files will conform automatically.