Skip to content
This repository has been archived by the owner on Feb 18, 2024. It is now read-only.

create-project doesn't pass the --fix option correctly to npm run lint #1261

Closed
edmorley opened this issue Dec 19, 2018 · 0 comments · Fixed by #1266
Closed

create-project doesn't pass the --fix option correctly to npm run lint #1261

edmorley opened this issue Dec 19, 2018 · 0 comments · Fixed by #1266
Assignees
Labels
Milestone

Comments

@edmorley
Copy link
Member

When create-project runs, if the user chose a lint preset then ESLint is run with the --fix option to ensure the template project adheres to the chosen style guide out of the box. (We can't do this in the Neutrino repository since some of the style guides conflict eg regarding trailing commas or semi-colons.)

This currently works fine when using yarn (create-project runs yarn lint --fix), however fails with npm since create-project runs npm run lint --fix which passes the --fix to npm instead of ESLint.

The correct command for NPM is instead npm run lint -- --fix.

This affects both Neutrino 8 and Neutrino 9.

@edmorley edmorley added the bug label Dec 19, 2018
@edmorley edmorley added this to the v9 milestone Dec 19, 2018
@edmorley edmorley self-assigned this Dec 19, 2018
edmorley added a commit that referenced this issue Dec 19, 2018
…1266)

Previously the `--fix` option was not passed to ESLint when using npm,
since it requires that any options passed be preceded with `--`.

This caused failures during create-project when users picked a lint preset
whose style differed from the template project, since the failures would
not be fixed, and instead ESLint exit non-zero causing create-project to
abort and delete the new project.

Fixes #1261.
timkelty pushed a commit to timkelty/neutrino that referenced this issue Dec 19, 2018
…eutrinojs#1266)

Previously the `--fix` option was not passed to ESLint when using npm,
since it requires that any options passed be preceded with `--`.

This caused failures during create-project when users picked a lint preset
whose style differed from the template project, since the failures would
not be fixed, and instead ESLint exit non-zero causing create-project to
abort and delete the new project.

Fixes neutrinojs#1261.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Development

Successfully merging a pull request may close this issue.

1 participant