Skip to content

refactor(oxlint,oxfmt): share config discovery code#21642

Merged
graphite-app[bot] merged 1 commit intomainfrom
c/04-22-refactor_oxlint_oxfmt_share_config_discovery_code
Apr 23, 2026
Merged

refactor(oxlint,oxfmt): share config discovery code#21642
graphite-app[bot] merged 1 commit intomainfrom
c/04-22-refactor_oxlint_oxfmt_share_config_discovery_code

Conversation

@camc314
Copy link
Copy Markdown
Contributor

@camc314 camc314 commented Apr 22, 2026

No description provided.

Copy link
Copy Markdown
Contributor Author

camc314 commented Apr 22, 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.

@codspeed-hq
Copy link
Copy Markdown

codspeed-hq Bot commented Apr 22, 2026

Merging this PR will improve performance by 3.26%

⚠️ Different runtime environments detected

Some benchmarks with significant performance changes were compared across different runtime environments,
which may affect the accuracy of the results.

Open the report in CodSpeed to investigate

⚡ 3 improved benchmarks
✅ 45 untouched benchmarks
⏩ 3 skipped benchmarks1

Performance Changes

Mode Benchmark BASE HEAD Efficiency
Simulation parser[RadixUIAdoptionSection.jsx] 83.8 µs 81.2 µs +3.09%
Simulation parser[react.development.js] 1.3 ms 1.3 ms +3.25%
Simulation parser[cal.com.tsx] 26.5 ms 25.6 ms +3.26%

Comparing c/04-22-refactor_oxlint_oxfmt_share_config_discovery_code (47e1a26) with main (f091d77)2

Open in CodSpeed

Footnotes

  1. 3 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

  2. No successful run was found on main (f0dc688) during the generation of this report, so f091d77 was used instead as the comparison base. There might be some changes unrelated to this pull request in this report.

@graphite-app graphite-app Bot force-pushed the c/04-22-refactor_linter_extract_reusable_config_discovery_helper branch 2 times, most recently from e978e6a to 2fc70db Compare April 22, 2026 16:25
@camc314 camc314 force-pushed the c/04-22-refactor_oxlint_oxfmt_share_config_discovery_code branch from 71a846d to fbe0f53 Compare April 22, 2026 16:31
@camc314 camc314 force-pushed the c/04-22-refactor_linter_extract_reusable_config_discovery_helper branch 2 times, most recently from 4530ee7 to ca4e3b0 Compare April 22, 2026 16:34
@camc314 camc314 force-pushed the c/04-22-refactor_oxlint_oxfmt_share_config_discovery_code branch from fbe0f53 to a6b2856 Compare April 22, 2026 16:34
@graphite-app graphite-app Bot changed the base branch from c/04-22-refactor_linter_extract_reusable_config_discovery_helper to graphite-base/21642 April 22, 2026 16:49
@camc314 camc314 force-pushed the c/04-22-refactor_oxlint_oxfmt_share_config_discovery_code branch from a6b2856 to 3145f5d Compare April 22, 2026 18:25
@camc314 camc314 force-pushed the graphite-base/21642 branch from ca4e3b0 to db7cc6d Compare April 22, 2026 18:25
@camc314 camc314 changed the base branch from graphite-base/21642 to main April 22, 2026 18:26
@camc314 camc314 force-pushed the c/04-22-refactor_oxlint_oxfmt_share_config_discovery_code branch from 3145f5d to fd84e06 Compare April 22, 2026 18:26
@camc314 camc314 force-pushed the c/04-22-refactor_oxlint_oxfmt_share_config_discovery_code branch 2 times, most recently from 6e35b88 to 2832d85 Compare April 23, 2026 07:25
@camc314 camc314 marked this pull request as ready for review April 23, 2026 07:27
@camc314 camc314 requested a review from leaysgur as a code owner April 23, 2026 07:27
Copilot AI review requested due to automatic review settings April 23, 2026 07:27
Copy link
Copy Markdown
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

This PR refactors oxlint and oxfmt to share configuration file discovery logic via a new oxc_config_discovery crate, reducing duplicated discovery code and aligning behavior across tools.

Changes:

  • Introduces crates/oxc_config_discovery with shared config discovery types (ConfigDiscovery, ConfigFileNames, DiscoveredConfigFile) and conflict diagnostics.
  • Updates oxlint and oxfmt to use the shared crate for config discovery and LSP watcher patterns.
  • Wires the new crate into the workspace and app dependency graphs.

Reviewed changes

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

Show a summary per file
File Description
crates/oxc_config_discovery/src/lib.rs Adds shared config discovery + conflict diagnostic formatting and tests.
crates/oxc_config_discovery/Cargo.toml Defines the new crate and its dependency on oxc_diagnostics.
apps/oxlint/src/lsp/server_linter.rs Reuses centralized config filename list for LSP file watching.
apps/oxlint/src/lib.rs Removes the old per-app config_discovery module.
apps/oxlint/src/config_loader.rs Switches oxlint config discovery/loading to oxc_config_discovery.
apps/oxlint/Cargo.toml Adds oxc_config_discovery dependency.
apps/oxfmt/src/lsp/server_formatter.rs Switches formatter LSP watchers to shared config filename list.
apps/oxfmt/src/core/utils.rs Makes vp_version() available unconditionally.
apps/oxfmt/src/core/mod.rs Renames/re-exports config filename helper to config_file_names.
apps/oxfmt/src/core/config.rs Replaces local config discovery logic with oxc_config_discovery.
apps/oxfmt/Cargo.toml Adds oxc_config_discovery dependency.
Cargo.toml Adds oxc_config_discovery to workspace dependencies.
Cargo.lock Records the new crate and updated dependency graph.
Comments suppressed due to low confidence (1)

crates/oxc_config_discovery/src/lib.rs:224

  • From<ConfigConflict> builds the note list from conflict.config_names() without sorting/deduping, while message() sorts the names. This can lead to inconsistent/different ordering between the error message and the note, and it will also change snapshot outputs that currently hardcode the old note string. Consider sorting (and optionally deduping) config_names before formatting the note, and update any existing snapshot/fixture expectations accordingly.

Comment thread apps/oxlint/src/lsp/server_linter.rs
Comment thread apps/oxfmt/src/core/config.rs
@camc314 camc314 force-pushed the c/04-22-refactor_oxlint_oxfmt_share_config_discovery_code branch from 2832d85 to ee22d18 Compare April 23, 2026 07:42
@camc314 camc314 requested a review from overlookmotel as a code owner April 23, 2026 07:42
@camc314 camc314 force-pushed the c/04-22-refactor_oxlint_oxfmt_share_config_discovery_code branch 3 times, most recently from 9916a88 to 652f4c4 Compare April 23, 2026 08:07
@camc314 camc314 requested a review from Copilot April 23, 2026 08:07
Copy link
Copy Markdown
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

Copilot reviewed 14 out of 15 changed files in this pull request and generated 1 comment.

Comment thread crates/oxc_config_discovery/Cargo.toml Outdated
@camc314 camc314 force-pushed the c/04-22-refactor_oxlint_oxfmt_share_config_discovery_code branch from 652f4c4 to 03b0a9d Compare April 23, 2026 08:17
@camc314 camc314 force-pushed the c/04-22-refactor_oxlint_oxfmt_share_config_discovery_code branch from 03b0a9d to 47e1a26 Compare April 23, 2026 08:18
Copy link
Copy Markdown
Member

@leaysgur leaysgur left a comment

Choose a reason for hiding this comment

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

Thank you~!

It looks fine at a glance, but I plan to take a close look tomorrow.

However, if this PR is necessary for other tasks to proceed, please feel free to merge it. 🙏🏻

@camc314
Copy link
Copy Markdown
Contributor Author

camc314 commented Apr 23, 2026

Thanks! I'll merge this now, then we can fix any issues we find in separate follow ups - this should help keep the changes isolated

@camc314 camc314 added the 0-merge Merge with Graphite Merge Queue label Apr 23, 2026
Copy link
Copy Markdown
Contributor Author

camc314 commented Apr 23, 2026

Merge activity

@graphite-app graphite-app Bot force-pushed the c/04-22-refactor_oxlint_oxfmt_share_config_discovery_code branch from 47e1a26 to fdd4c92 Compare April 23, 2026 10:12
@graphite-app graphite-app Bot merged commit fdd4c92 into main Apr 23, 2026
27 of 28 checks passed
@graphite-app graphite-app Bot removed the 0-merge Merge with Graphite Merge Queue label Apr 23, 2026
@graphite-app graphite-app Bot deleted the c/04-22-refactor_oxlint_oxfmt_share_config_discovery_code branch April 23, 2026 10:16
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.

3 participants