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

Can't create new projects that uses prettier #4310

Closed
filimon-danopoulos-stratsys opened this issue Jul 18, 2019 · 4 comments · Fixed by #4329
Closed

Can't create new projects that uses prettier #4310

filimon-danopoulos-stratsys opened this issue Jul 18, 2019 · 4 comments · Fixed by #4329
Labels

Comments

@filimon-danopoulos-stratsys

Version

3.9.2

Environment info

  System:
    OS: Windows 10
    CPU: (12) x64 Intel(R) Core(TM) i7-8700K CPU @ 3.70GHz
  Binaries:
    Node: 10.16.0 - C:\Program Files\nodejs\node.EXE
    Yarn: 1.9.4 - C:\Program Files (x86)\Yarn\bin\yarn.CMD
    npm: 6.10.1 - C:\Program Files\nodejs\npm.CMD
  Browsers:
    Edge: 42.17134.1.0
  npmGlobalPackages:
    @vue/cli: Not Found

Steps to reproduce

  • Run vue create sample-app
  • Pick "Manually select features"
  • Check "Linter"
  • Select "Prettier"
  • Pick "Lint on Save"

What is expected?

A new project is created.

What is actually happening?

The following error is thrown Error: Failed to load plugin prettier: Cannot find module 'eslint-plugin-prettier'

@filimon-danopoulos-stratsys filimon-danopoulos-stratsys changed the title Can't create new projects that use prettier Can't create new projects that uses prettier Jul 18, 2019
@gabemule
Copy link

gabemule commented Jul 18, 2019

The same occurs on old project when deleting yarn.lock/package-lock.json and reinstalling dependencies.

Installing manually "eslint-plugin-prettier" fixes the error, but I believe that this should be a dependency of "@vue/eslint-config-prettier" maybe...

@max8hine
Copy link

Same here.
image

@staticfire
Copy link

Same issue.

yarn install eslint-plugin-prettier solved the problem.

@filimon-danopoulos-stratsys
Copy link
Author

@gabemule You are probably correct.

haoqunjiang added a commit to vuejs/eslint-config-prettier that referenced this issue Jul 22, 2019
BREAKING CHANGE:
This commit also moves eslint & prettier to peerDependencies.

After this change, users will have to manually install these
dependencies into their project root.

Previously we listed the plugin as a dependency of this config, and that
only works because package managers will hoist the plugin to project
root. This trick is not reliable with current eslint implementation.
This also resulted in a bug when the package manager failed to correctly
hoist the plugin package, see vuejs/vue-cli#4310

More details can be seen at:
- eslint/eslint#3458
- eslint/rfcs#5
haoqunjiang added a commit to haoqunjiang/vue-cli that referenced this issue Jul 22, 2019
This only affects newly generated projects so it's not considered a
breaking change.

Fixes vuejs#4310
haoqunjiang added a commit that referenced this issue Jul 22, 2019
…#4329)

This only affects newly generated projects so it's not considered a
breaking change.

Fixes #4310
haoqunjiang added a commit that referenced this issue Aug 2, 2019
…#4329)

This only affects newly generated projects so it's not considered a
breaking change.

Fixes #4310

(cherry picked from commit 6207dd9)
goldentroll added a commit to goldentroll/eslint-config-prettier that referenced this issue Mar 14, 2023
BREAKING CHANGE:
This commit also moves eslint & prettier to peerDependencies.

After this change, users will have to manually install these
dependencies into their project root.

Previously we listed the plugin as a dependency of this config, and that
only works because package managers will hoist the plugin to project
root. This trick is not reliable with current eslint implementation.
This also resulted in a bug when the package manager failed to correctly
hoist the plugin package, see vuejs/vue-cli#4310

More details can be seen at:
- eslint/eslint#3458
- eslint/rfcs#5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants