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

fix(cli-plugin-eslint): make eslint deps optional #3068

Merged
merged 2 commits into from
Feb 17, 2019

Conversation

haoqunjiang
Copy link
Member

@haoqunjiang haoqunjiang commented Dec 3, 2018

  1. In @vue/cli-plugin-eslint 3.1.0+, eslint will be explicitly added to
    the project's package.json, so it is optional.
  2. optionalDependencies will still be installed by npm by default,
    just no longer cause installation to fail when error happens.
  3. ESLint v4 did cause weird errors sometimes, like npm WARN ajv-keywords@2.1.1 requires a peer of ajv@^5.0.0 but none is installed.
    Though this warning never caused any errors on my machine, I think it's
    good to make the plugin fail-safe.

This change fixes #3009

1. In @vue/cli-plugin-eslint 3.1.0+, eslint will be explicitly added to
the project's package.json, so it is **optional**.
2. `optionalDependencies` will still be installed by npm by default,
just no longer cause installation to fail when error happens.
3. ESLint v4 did cause weird errors sometimes, like `npm WARN
ajv-keywords@2.1.1 requires a peer of ajv@^5.0.0 but none is installed.`
Though this warning never caused any errors on my machine, I think it's
good to make the plugin fail-safe.
@haoqunjiang
Copy link
Member Author

This should also fix #2567 (comment)

@haoqunjiang
Copy link
Member Author

haoqunjiang commented Dec 3, 2018

Note: This may break use cases like this if their projects were created by @vue/cli v3.0.x: #1242 (comment)

Edit: according to #1242 (comment) so this feature never works correctly before, so I think it's safe to break it.

@nether-cat
Copy link

Any updates on this? 🙂

Copy link
Member

@michalsnik michalsnik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@haoqunjiang haoqunjiang merged commit 114313c into vuejs:dev Feb 17, 2019
@one-pieces
Copy link

This update will break the projects were created by @vue/cli v3.0.x

15510721336364

@haoqunjiang
Copy link
Member Author

@one-pieces Did you run npm install with --no-optional? I didn't expect that use case to exist… 😂

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Missing dependencies on default template install on windows
4 participants