refactor(oxlint,oxfmt): share config discovery code#21642
Conversation
Merging this PR will improve performance by 3.26%
|
| 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
Footnotes
-
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. ↩
-
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. ↩
e978e6a to
2fc70db
Compare
71a846d to
fbe0f53
Compare
4530ee7 to
ca4e3b0
Compare
fbe0f53 to
a6b2856
Compare
a6b2856 to
3145f5d
Compare
ca4e3b0 to
db7cc6d
Compare
3145f5d to
fd84e06
Compare
6e35b88 to
2832d85
Compare
There was a problem hiding this comment.
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_discoverywith shared config discovery types (ConfigDiscovery,ConfigFileNames,DiscoveredConfigFile) and conflict diagnostics. - Updates
oxlintandoxfmtto 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 thenotelist fromconflict.config_names()without sorting/deduping, whilemessage()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_namesbefore formatting the note, and update any existing snapshot/fixture expectations accordingly.
2832d85 to
ee22d18
Compare
9916a88 to
652f4c4
Compare
652f4c4 to
03b0a9d
Compare
03b0a9d to
47e1a26
Compare
leaysgur
left a comment
There was a problem hiding this comment.
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. 🙏🏻
|
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 |
Merge activity
|
47e1a26 to
fdd4c92
Compare

No description provided.