Skip to content

fix(linter): merge env from extended config files#20088

Open
Sysix wants to merge 1 commit into03-07-refactor_linter_resolve_globals_from_env_on_buildfrom
03-06-fix_linter_merge_env_from_extended_config_files
Open

fix(linter): merge env from extended config files#20088
Sysix wants to merge 1 commit into03-07-refactor_linter_resolve_globals_from_env_on_buildfrom
03-06-fix_linter_merge_env_from_extended_config_files

Conversation

@Sysix
Copy link
Member

@Sysix Sysix commented Mar 6, 2026

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

Copy link
Member Author

Sysix commented Mar 6, 2026

Warning

This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
Learn more


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 C-bug Category - Bug labels Mar 6, 2026
@Sysix Sysix force-pushed the 03-06-fix_linter_merge_env_from_extended_config_files branch 4 times, most recently from e560f76 to 683efae Compare March 6, 2026 19:52
@Sysix Sysix requested a review from Copilot March 6, 2026 19:54
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

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::merge to merge env from extended configs, with the current config taking precedence.
  • Add an OxlintEnv::merge helper to support merging env maps.
  • Add a CLI fixture + snapshot test to validate env inheritance 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/fixtures__cli__extends_env_@oxlint.snap 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.

@codspeed-hq
Copy link

codspeed-hq bot commented Mar 6, 2026

Merging this PR will not alter performance

✅ 4 untouched benchmarks
⏩ 52 skipped benchmarks1


Comparing 03-06-fix_linter_merge_env_from_extended_config_files (1451935) with 03-07-refactor_linter_resolve_globals_from_env_on_build (7f99530)

Open in CodSpeed

Footnotes

  1. 52 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.

@Sysix Sysix force-pushed the 03-06-fix_linter_merge_env_from_extended_config_files branch from 683efae to 702d3f8 Compare March 6, 2026 20:09
@Sysix Sysix requested a review from Copilot March 6, 2026 20:10
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

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

@Sysix Sysix changed the base branch from main to graphite-base/20088 March 7, 2026 19:10
@Sysix Sysix force-pushed the 03-06-fix_linter_merge_env_from_extended_config_files branch from 702d3f8 to 225cd82 Compare March 7, 2026 19:10
@Sysix Sysix changed the base branch from graphite-base/20088 to 03-07-refactor_linter_resolve_globals_from_env_on_build March 7, 2026 19:10
@Sysix Sysix marked this pull request as ready for review March 7, 2026 19:19
@Sysix Sysix requested a review from camc314 as a code owner March 7, 2026 19:19
@camc314 camc314 self-assigned this Mar 9, 2026
@Sysix Sysix force-pushed the 03-06-fix_linter_merge_env_from_extended_config_files branch from 225cd82 to eb639a1 Compare March 9, 2026 19:25
@Sysix Sysix force-pushed the 03-07-refactor_linter_resolve_globals_from_env_on_build branch from c2d4fb9 to ccf8d18 Compare March 9, 2026 19:25
@Sysix Sysix force-pushed the 03-06-fix_linter_merge_env_from_extended_config_files branch from eb639a1 to 66d0c24 Compare March 9, 2026 19:44
@Sysix Sysix force-pushed the 03-07-refactor_linter_resolve_globals_from_env_on_build branch from ccf8d18 to f75f83c Compare March 9, 2026 19:44
@graphite-app graphite-app bot force-pushed the 03-07-refactor_linter_resolve_globals_from_env_on_build branch from f75f83c to 58a1a9c Compare March 9, 2026 22:30
@graphite-app graphite-app bot requested a review from overlookmotel as a code owner March 9, 2026 22:30
@graphite-app graphite-app bot force-pushed the 03-07-refactor_linter_resolve_globals_from_env_on_build branch from 58a1a9c to 7f99530 Compare March 9, 2026 22:31
@graphite-app graphite-app bot force-pushed the 03-06-fix_linter_merge_env_from_extended_config_files branch from 66d0c24 to 1451935 Compare March 9, 2026 22:31
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 C-bug Category - Bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

linter: env config is not inherited when using extends

3 participants