eslint-config-prettier is used but not listed in peerDependencies or devDependencies
See original GitHub issueWhat version of eslint-plugin-prettier
are you using?
3.0.1
Please paste any applicable config files that you’re using (e.g. .prettierrc
or .eslintrc
files)
{
"extends": [
"eslint:recommended",
"plugin:prettier/recommended"
],
}
What did you expect to happen?
When I install eslint-plugin-prettier
I expect that eslint-config-prettier
referenced in recommended settings will be installed automatically (or at least will appear in peerDependencies
).
What actually happened?
I have to manually install eslint-config-prettier
.
Issue Analytics
- State:
- Created 5 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
eslint should be listed in the project's dependencies, not ...
Solved it with adding this to my .eslintrc : "import/no-extraneous-dependencies": ["error", {"devDependencies": true}].
Read more >eslint-config-prettier-standard | Yarn - Package Manager
An ESLint shareable config for projects using Prettier and JavaScript Standard Style as ESLint rules. Installation. These instructions assume that you've ...
Read more >Reduce maintenance effort with shared ESLint and Prettier ...
Making ESLint and Prettier configurations available in a separate package supports reusability and reduces maintenance effort.
Read more >@calvium/eslint-config - npm
To use this package you MUST install all peer dependencies of this package as devDependencies even if you are not using the relevant ......
Read more >How to create custom reusable ESLint, TypeScript, Prettier ...
And let's not forget about TypeScript! ... eslint , eslint-plugin-react packages as dev dependencies in the project (in your specific use ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
There are some downsides to our current approach – ESLint usually loads shareable configs relative to the config that extends them, so it would attempt to resolve
eslint-config-prettier
from the location ofeslint-plugin-prettier
rather than from the user’s project. As a result, under some package management setups (e.g. Yarn Plug n’ Play) ESLint could fail to find theeslint-config-prettier
package even though the user installed it in their project.A solution would be to add
eslint-plugin-prettier
as a dependency rather than as apeerDependency
; this would avoid the need for the user to manually install it, although it would still add unnecessary installation time in some cases. The user would no longer be able to customize the version ofeslint-config-prettier
that gets used through this plugin, although if they want customization they could just install their own version ofeslint-plugin-prettier
.Agree, having
eslint-config-prettier
independencies
will solve the issue. I highly doubt that somebody would want to have own version of it, most likely if there’s something important in a new version theneslint-plugin-prettier
would already have the updated one.Anyways, sudden death because of a missing dependency not listed anywhere except in readme is a no go 😦