Implement automatic two-pass linting when both JS plugins and import plugin are enabled#15881
Closed
Implement automatic two-pass linting when both JS plugins and import plugin are enabled#15881
Conversation
Contributor
How to use the Graphite Merge QueueAdd either label to this PR to merge it via the merge queue:
You must have a Graphite account in order to use the merge queue. Sign up using this link. An organization admin has enabled the Graphite Merge Queue in this repository. Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue. |
- Detect when both JS plugins and import plugin are enabled - Automatically run two internal passes instead of failing - First pass: native rules + import plugin + type-aware linting (no JS plugins) - Second pass: only JS plugins (no native rules, no type-aware linting) - Merge diagnostics from both passes into single output - Export FixOptions and InlineConfigOptions for internal use Co-authored-by: overlookmotel <557937+overlookmotel@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add automatic two-pass linting for oxlint with JS and import plugins
Implement automatic two-pass linting when both JS plugins and import plugin are enabled
Nov 19, 2025
|
that would be great and would simplify end user configurations, for example in my case I now have to use 3 different oxlint processes (import, Angular, Cypress) which also mean 3 separate tasks in my CI |
Contributor
|
I'm working on a fix similar to this |
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.
When both JS-based plugins and the import plugin are enabled on large codebases (10k+ files), oxlint exhausts resources due to architectural conflicts between the two plugin types. Previously required users to manually run two separate lint passes.
Changes
Automatic pass detection and orchestration (
apps/oxlint/src/lint.rs):use_cross_module(import plugin) andhas_external_linter(JS plugins) are trueDiagnosticServicecollects and merges results from both passesrun_two_pass_lint_implstatic method to orchestrate passes without self-borrowing issuesType exports (
apps/oxlint/src/command/mod.rs):FixOptionsandInlineConfigOptionsfor internal two-pass implementationBehavior
Users see combined diagnostics from both passes as a single lint run. Single-plugin configurations unchanged.
Remaining Work
Original prompt
Implement automatic two-pass linting in oxlint when both JS-based plugins and the import plugin are enabled, as described in #15863 and the @copilot instructions.
Context from the maintainer's comment:
Required behavior:
Detect when BOTH of the following are true for a given lint run:
external_linteror equivalent configuration flag for JS-based plugins).In that case, perform linting in two internal passes instead of a single pass, without requiring user intervention:
Implementation notes from the maintainer:
external_lintertoNone(or the relevant configuration mechanism that disables JS plugins) while keeping the rest of the configuration the same.Design and implementation constraints:
oxlintinvocation from the user's perspective:CLI / configuration behavior:
--no-split-js-import-passesor--split-js-import-passes), follow that pattern.Tests:
oxc-project/oxc.Documentation:
Please:
external_linterand the import plugin are wired into the runtime.This pull request was created as a result of the following prompt from Copilot chat.
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.