Repository navigation
fix: config file params ignored when using -f flag - #1
Merged
Merged
Conversation
…ed with -f Yargs defaults for these 4 options prevented config file values from being used. The nullish coalescing chain in mergeConfig never reached fileConfig because yargs always provided a concrete value (false/1) instead of undefined. https://claude.ai/code/session_01AUCATaYV2rG63t1Yu8tjHq
There was a problem hiding this comment.
Pull request overview
Fixes an issue where config-file values were being ignored when -f/--config was used, because yargs defaults caused mergeConfig() to treat certain options as explicitly set via CLI.
Changes:
- Removed yargs
defaultvalues formerge,parallel,clear, anddelete-missingso config-file values can win when the CLI flag isn’t provided. - Added
mergeConfig()unit tests to cover config-file precedence, CLI overrides, and fallback to defaults.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
src/cli.ts |
Stops yargs from pre-populating key options so mergeConfig() can correctly apply config-file values. |
src/__tests__/parser.test.ts |
Adds focused tests validating mergeConfig() precedence order (CLI > file > defaults). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
Summary
defaultvalues from yargs formerge,parallel,clear, anddeleteMissingoptions — these defaults were overriding config file values since yargs always populated them, makingmergeConfig()think the CLI had explicitly set themmergeConfigtests covering file config, CLI override, and defaults-only scenarios