fix(config): child config is overridden by parent config#21041
Closed
Leonabcd123 wants to merge 1 commit intooxc-project:mainfrom
Closed
fix(config): child config is overridden by parent config#21041Leonabcd123 wants to merge 1 commit intooxc-project:mainfrom
Leonabcd123 wants to merge 1 commit intooxc-project:mainfrom
Conversation
Sysix
reviewed
Apr 4, 2026
Member
Sysix
left a comment
There was a problem hiding this comment.
Thank you for the fix. I could test it locally it, your approach works and fixes both bugs.
I think your fix is not resolving the core problem.
The function caller will fall back to the base config, if no nested config is found. We want this code path to trigger.
I created a test and a fix in #21051 which resolve the underlying problem.
Your PR helped me to identify the root problem. Thank you for that!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #21030, Fixes #20904
The problem was that when trying to resolve the current config file when linting some file, we walk up that file's ancestors until we find a nested config that applies to that directory, but we don't check whether the base config file applies to it. This means that if the file structure looks something like this:
and our cwd was
dir, and we ranoxlint file_to_lint.ts, the base config file would bedir/oxlint.config.ts(because it's in the current working directory) and the nested config would beoxlint.config.ts, so when resolving the final config file forfile_to_lint.ts,dir/oxlint.config.tswould be skipped (because we don't check whether the base config applies), and thusoxlint.config.tswould be the one to take effect.This pr makes it so we also check whether the base config applies to the current file, as well as nested configs.