Skip to content

refactor(linter): extract vite lint config in JS loader#20228

Closed
camc314 wants to merge 1 commit intomainfrom
c/03-11-oxlint_extract_vite_lint_config_in_js_loader
Closed

refactor(linter): extract vite lint config in JS loader#20228
camc314 wants to merge 1 commit intomainfrom
c/03-11-oxlint_extract_vite_lint_config_in_js_loader

Conversation

@camc314
Copy link
Contributor

@camc314 camc314 commented Mar 11, 2026

No description provided.

Copy link
Contributor Author

camc314 commented Mar 11, 2026


How to use the Graphite Merge Queue

Add either label to this PR to merge it via the merge queue:

  • 0-merge - adds this PR to the back of the merge queue
  • hotfix - for urgent changes, fast-track this PR to the front of 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.

This stack of pull requests is managed by Graphite. Learn more about stacking.

@github-actions github-actions bot added A-linter Area - Linter A-cli Area - CLI A-linter-plugins Area - Linter JS plugins labels Mar 11, 2026
@camc314 camc314 changed the title oxlint: extract vite lint config in JS loader refactor(linter): extract vite lint config in JS loader Mar 11, 2026
@github-actions github-actions bot added the C-cleanup Category - technical debt or refactoring. Solution not expected to change behavior label Mar 11, 2026
@camc314 camc314 force-pushed the c/03-11-oxlint_extract_vite_lint_config_in_js_loader branch from ac0b786 to 4a9c448 Compare March 11, 2026 10:54
@camc314 camc314 force-pushed the c/03-11-oxlint_extract_vite_lint_config_in_js_loader branch from 4a9c448 to b396df5 Compare March 11, 2026 21:20
@camc314 camc314 marked this pull request as ready for review March 11, 2026 21:44
@camc314 camc314 requested a review from overlookmotel as a code owner March 11, 2026 21:44
Copilot AI review requested due to automatic review settings March 11, 2026 21:44
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Refactors Vite config handling so that vite.config.ts is interpreted on the JS side by extracting the .lint field before sending the config payload back to Rust, rather than doing .lint extraction in the Rust JSON response parser.

Changes:

  • Move Vite .lint field extraction from Rust (parse_js_config_response) into the Node/TS loader (loadJsConfigs).
  • Adjust fixture snapshot to reflect new behavior when a vite.config.ts has no .lint field (now lints with defaults instead of failing config parse).
  • Add a Rust unit test ensuring parse_js_config_response accepts the new “already-extracted” payload shape.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

File Description
apps/oxlint/test/fixtures/vite_config_no_lint_field/output.snap.md Updates expected output for the “no lint field” Vite fixture to match new loader semantics.
apps/oxlint/src/lib.rs Removes the no-longer-needed VITE_OXLINT_CONFIG_FIELD constant.
apps/oxlint/src/js_config.rs Removes Vite-specific .lint extraction during Rust-side parsing; adds a regression test for the new payload shape.
apps/oxlint/src-js/js_config.ts Implements Vite .lint extraction in the JS loader and runs extends validation on the extracted object.

You can also share your feedback on Copilot code review. Take the survey.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-cli Area - CLI A-linter Area - Linter A-linter-plugins Area - Linter JS plugins C-cleanup Category - technical debt or refactoring. Solution not expected to change behavior

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants