fix(linter): merge env from extended config files#20088
Conversation
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. This stack of pull requests is managed by Graphite. Learn more about stacking. |
e560f76 to
683efae
Compare
There was a problem hiding this comment.
Pull request overview
This PR fixes Oxlint config resolution so that env values are inherited from extended (extends) configuration files, addressing missing globals when env was defined only in a base config.
Changes:
- Update
Oxlintrc::mergeto mergeenvfrom extended configs, with the current config taking precedence. - Add an
OxlintEnv::mergehelper to support merging env maps. - Add a CLI fixture + snapshot test to validate
envinheritance and override behavior.
Reviewed changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| crates/oxc_linter/src/config/oxlintrc.rs | Merge env from extended configs instead of ignoring it. |
| crates/oxc_linter/src/config/env.rs | Add OxlintEnv::merge to combine environment maps. |
| apps/oxlint/src/lint.rs | Add a regression test that runs the new extends_env fixture. |
| apps/oxlint/src/snapshots/[email protected] | Snapshot asserting only the override case reports console as undefined. |
| apps/oxlint/fixtures/cli/extends_env/** | New fixture configs/files covering inheritance + override of env. |
Merging this PR will not alter performance
Comparing Footnotes
|
683efae to
702d3f8
Compare

closes #20087
POC: need to check if everything is fine, specially with
globals