`eslint-config-react-app@7.0.0` using dependencies instead of peerDependencies
See original GitHub issueUsing dependencies
for plugins in sharable configs for eslint
is an antipattern. According to the docs, these dependencies should be put to peerDependencies
. The reason is that multiple sharable configs could lock their version of plugins and expect different implementation and eslint wouldn’t know which one to use. The user should be always the one to select and install eslint plugins. Reused shareable configs, parsers or other packages can be in dependencies
tho.
The older version of eslint-config-react-app
had it correct, the new version has it wrong.
Issue Analytics
- State:
- Created 2 years ago
- Reactions:13
- Comments:5
Top Results From Across the Web
Packages should use dependencies instead of ... - GitHub
We were hoping that peerDependencies could be used as a way to signal which dependencies should be shared with other packages. Even to...
Read more >Why use peer dependencies in npm for plugins?
TL;DR: peerDependencies are for dependencies that are exposed to (and expected to be used by) the consuming code, as opposed to "private" dependencies...
Read more >Understanding Peer Dependencies in JavaScript
Peer dependencies are almost like normal dependencies, but instead of defining a strong requirement between A and B (i.e the project you're ...
Read more >Peer Dependencies | Node.js
The Problem: Plugins. There's one use case where this falls down, however: plugins. A plugin package is meant to be used with another...
Read more >dependencies vs devDependencies vs peerDependencies
Usually, these libraries have all or part of their code in your final bundle(s). You can add them in your project using the...
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 FreeTop 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
Top GitHub Comments
plugins
declared as apeerdependency
may not be a wrong.Because
eslint-config-react-app@7.0.0
use@rushstack/eslint-patch/modern-module-resolution
. This patch allows a shared ESLint config to bring along its own plugins, rather than imposing peer dependencies on every consumer of the config. For more detail see @rushstack/eslint-patchhttps://github.com/facebook/create-react-app/blob/f34d88e30c7d8be7181f728d1abc4fd8d5cd07d3/packages/eslint-config-react-app/base.js#L11
Not really. The fact that it conflicts at the consuming side with other plugins means that solution doesn’t work.