Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Options are duplicated when passing them to tasks #341

Closed
mtlewis opened this issue May 7, 2020 · 1 comment
Closed

Options are duplicated when passing them to tasks #341

mtlewis opened this issue May 7, 2020 · 1 comment
Labels
bug Something isn't working

Comments

@mtlewis
Copy link
Contributor

mtlewis commented May 7, 2020

Ran into this when updating to web-scripts 7 - it looks like something is wrong with the way that args are parsed in index.ts which causes tasks to receive config containing multiple instances of each command in nested arrays.

The below command shows part of the output after adding console.log(task.restOptions) inside eslintRun.

> yarn web-scripts lint --arg-one=foo --arg-two=bar
< [
<   '--arg-one=foo',
<   '--arg-two=bar',
<   [ '--arg-one=foo', '--arg-two=bar' ]
< ]

This causes concrete issues when running eslint - it looks the array is causing the later arguments to be concatenated onto the value of the first, so commands like the one below produce an error:

> yarn web-scripts lint --ignore-path=.gitignore --format=checkstyle
< /* snip */
< Cannot read .eslintignore file: /<project-root>/.gitignore,--format=checkstyle
@fastfrwrd fastfrwrd added the bug Something isn't working label May 13, 2020
@fastfrwrd
Copy link

this is very likely to be caused by the bump to commander 5

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants