Fix npm script argument passing with double dash separator#87
Merged
hyldmo merged 2 commits intofix/npm-command-shorthandfrom Mar 16, 2026
Merged
Fix npm script argument passing with double dash separator#87hyldmo merged 2 commits intofix/npm-command-shorthandfrom
hyldmo merged 2 commits intofix/npm-command-shorthandfrom
Conversation
npm:lint --fix now correctly expands to `npm run lint -- --fix` so that extra arguments are forwarded to the underlying script rather than consumed by the package manager. https://claude.ai/code/session_01DCLpbD8YCmBL8fYjVfK1aZ
Widen env type to Record<string, string | undefined> so the delete on NO_COLOR doesn't trigger TS2339. https://claude.ai/code/session_01DCLpbD8YCmBL8fYjVfK1aZ
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
Fixed npm script argument passing to properly use the
--separator between the script name and forwarded arguments. This ensures that extra arguments are correctly passed to the npm script rather than being interpreted as npm options.Changes
expandScriptCommand()insrc/config/expand-scripts.tsto insert--between the script name and extra arguments when arguments are presentsrc/config/expand-scripts.test.tsto reflect the corrected command formatImplementation Details
The fix changes the command generation from:
npm run lint:js --fix(incorrect - npm interprets--fixas an npm option)To:
npm run lint:js -- --fix(correct ---tells npm to pass remaining args to the script)This applies to all script expansion patterns including:
lint:* --fix)npm:lint:* --fix)npm:lint --fix)--fix --quiet)https://claude.ai/code/session_01DCLpbD8YCmBL8fYjVfK1aZ