When passing args to a script, when using yarn, extra "--" argument is added
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 816
- Forks
- 88
- PR merge metrics
- No merged PRs in 30d
Description
Describe the bug
Unlike with npm, when using yarn to run scripts, it is not necessary to pass -- to separate arguments to the script from the arguments to yarn itself. When doing so, the -- is passed through to the script unchanged. This can cause an issue if the script itself is not expecting to receive this argument.
Note that pnpm also does not require the -- so it appears that npm is currently a special case in this regard.
To Reproduce
Steps to reproduce the behavior:
- Create a script in
package.jsonthat does something with its arguments, e.g."test": "echo args:" - Run that script via lage, with arguments, using yarn as the script runner
- Notice whether
--is provided as an argument to the script
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the behavior with a package.json script that inspects its arguments, invoking it through lage with yarn as the script runner. Compare the arguments received through yarn with npm and pnpm; done means the extra "--" is no longer passed to the script when it is used only to separate runner arguments.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- cli, tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100