create-react-app
create-react-app copied to clipboard
`[email protected]` using dependencies instead of peerDependencies
Using 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.
Can someone look into this? This is a blocking issue.
I encountered the same problem
plugins
declared as a peerdependency
may not be a wrong.
Because [email protected]
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-patch
https://github.com/facebook/create-react-app/blob/f34d88e30c7d8be7181f728d1abc4fd8d5cd07d3/packages/eslint-config-react-app/base.js#L11
plugins declared as a peerdependency may not be a wrong.
Not really. The fact that it conflicts at the consuming side with other plugins means that solution doesn't work.