Skip to content

Options are duplicated when passing them to tasks #341

@mtlewis

Description

@mtlewis

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions