question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

eslint-config-prettier is used but not listed in peerDependencies or devDependencies

See original GitHub issue

What 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:closed
  • Created 5 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
not-an-aardvarkcommented, Jan 6, 2019

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 of eslint-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 the eslint-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 a peerDependency; 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 of eslint-config-prettier that gets used through this plugin, although if they want customization they could just install their own version of eslint-plugin-prettier.

0reactions
kirill-konshincommented, Jan 7, 2019

Agree, having eslint-config-prettier in dependencies 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 then eslint-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 😦

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found