Repository navigation
fix: apply config filename precedence per directory - #6454
Open
akasakariko wants to merge 1 commit into
Open
akasakariko wants to merge 1 commit into
akasakariko wants to merge 1 commit into
Conversation
|
Contributor
|
👋 Hi @akasakariko, thanks for the pull request! A scan flagged a concern with it. Could you please take a look? [pr-task-completion] This PR's body is missing
Repositories often provide a set of tasks that pull request authors are expected to complete. Those tasks should be marked as completed with a
|
Contributor
Mixed activityActivity patterns show a mix of organic and automated signals. Evidence
This is an automated analysis by AgentScan |
findConfig searched the whole tree for each config filename in turn, so an ancestor .mocharc.cjs won over a local .mocharc.js. Walk one directory level at a time and confine each filename lookup to that directory closes mochajs#6395
akasakariko
force-pushed
the
fix/6395-config-precedence-per-directory
branch
from
October 27, 2026 13:24
4e3f5df to
a8ed7ac
Compare
Author
|
recheck |
This branch has not been deployed
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.
PR Checklist
status: accepting prsIssue #6395 is still labeled
status: in triage, so the second item stays unchecked until a maintainer relabels itOverview
Since 12.0.2,
findConfigcalls find-up-simple once per filename, so.mocharc.cjsis searched up to the filesystem root before.mocharc.jsis looked for in the current directory. A parent.mocharc.cjsis loaded even when the working directory has its own.mocharc.jsfindUpSyncAnynow walks one directory level at a time and confines each filename lookup to that directory viastopAt. Filename priority applies only among files in the same directory. Parent lookup is unchanged when the current directory has no config fileVerification
npm run test-node: exit 0, including 1304 unit and 391 integration passing.mocharc.jsis now used, while 12.0.3 used the parent.mocharc.cjsTests
findConfig()unit tests to assert the per-directory search order.mocharc.jsnext to an ancestor.mocharc.cjs, which fails without the fixlint:knip-docsstill reports the pre-existing unusedsatteridependency indocs/package.json