Repository navigation
feat(lint): enforce import ordering and deduplication - #124730
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs maintainer review before merge. Reviewed August 16, 2026, 2:29 PM ET / 18:29 UTC. ClawSweeper reviewWhat this changesThe PR enables Oxlint errors for duplicate imports and production import placement, while reorganizing existing imports across the current source, plugin, UI, and script lint lanes. Merge readinessKeep this maintainer-owned lint-policy PR open for normal merge handling: its narrowed enforcement claim matches the existing Oxlint lanes, but the local partial clone could not materialize the PR head for a complete 456-file diff review. Priority: P3 Review scores
Verification
How this fits togetherThe lint wrapper sends repository source through three Oxlint shards before CI accepts changes. These rules reject duplicate imports and production imports placed after executable code in the lanes that the wrapper targets. flowchart LR
A[Source and plugin files] --> B[Oxlint configuration]
B --> C[Import rules]
C --> D[Core plugin and script shards]
D --> E[CI lint jobs]
E --> F[Contributor feedback]
Before merge
Agent review detailsSecurityNone. Review metrics
Stored data modelPersistent data-model change detected: Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Land only as enforcement for the existing Oxlint lanes; add a dedicated root-test lint lane later if maintainers want duplicate-import checks across all tests. Do we have a high-confidence way to reproduce the issue? Not applicable: this is a lint-policy change, and the relevant check is the configured lint-lane topology rather than a runtime reproduction. Is this the best way to solve the issue? Yes for the stated lane-scoped goal: the current wrappers and CI target the same lanes named by the PR, and the prior root-test coverage request was explicitly narrowed rather than silently dropped. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 9d0c1f8f8c59. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (1 earlier review cycle)
|
|
ClawSweeper finding addressed by narrowing the PR wording to the existing oxlint-covered lanes. Rank-up move skipped: adding a new type-aware |
|
Land-ready proof for
No changelog or live-provider proof is needed for this internal lint-policy campaign. |
|
Merged via squash.
|
* refactor(imports): dedupe and hoist imports * feat(lint): enforce import/no-duplicates and import/first
What Problem This Solves
The oxlint import plugin was active, but
import/no-duplicatesandimport/firstremained disabled because the repository still had 347 duplicate-import findings and 1,956 import-placement findings. That left new duplicate imports and late production imports unguarded.Why This Change Was Made
This cleans duplicate imports across every existing oxlint lane, hoists production imports while preserving module-request order, and enables both rules at error.
import/firststays disabled for test files because 1,430 of 1,553 test findings (92.1%) follow Vitest's intentionally hoistedvi.mock/vi.unmocksetup; one production file retains a narrow exception for an explicit maintenance side-effect import.When duplicate side-effect and binding imports were consolidated, the surviving binding import was kept in the original first module-request slot. A documented
oxfmt-ignorebarrier protects those 22 test-harness setup imports from the formatter's import sorter.User Impact
No user-visible runtime behavior changes. Contributors now get immediate lint failures for duplicate imports in oxlint-covered files and for imports placed after production statements.
Evidence
import/no-duplicates: 347 findings before (245 production, 102 test) → 0.import/first: 1,956 findings before (403 production, 1,553 test) → 0 in the enabled scope. The remaining forced-rule survey has one documented production exception and 1,545 test findings covered by the Vitest override.pnpm lint— green across core, plugin, and scripts oxlint lanes plus Control UI i18n/style checks.node scripts/run-vitest.mjs test/scripts/oxlint-config.test.ts— 12 passed.node scripts/check-changed.mjsreached Testbox in run 31962427151 but the delegated checkout reported no reachableorigin/mainancestor and stopped on assertion-ratchet entries in two files outside this diff. Exact-head PR CI remains the authoritative broad gate.