Reputation: 3109
If I have the following monorepo set up
is-even
in it's package.jsonis-even
in its package.jsonis-even
Then currently, I don't get any warning from something like eslint-plugin-import, when preferably, I would like an error because if I publish app2, then any user that tries to install it from NPM will receive errors because it does not properly specify that it needs is-even
as a dependency
Reproducible case here with a minimal monorepo https://github.com/cmdcolin/yarn_workspaces_eslint_plugin_import
Upvotes: 1
Views: 1882
Reputation: 3109
This was fixed by adding
extends:
- eslint:recommended
- plugin:import/recommended
rules:
import/no-extraneous-dependencies: error
This makes it detect the error properly, e.g. this message is expected and good now
yarn run v1.22.15
$ eslint .
/home/cdiesh/test/packages/app2/src/index.js
1:1 error 'is-even' should be listed in the project's dependencies. Run 'npm i -S is-even' to add it import/no-extraneous-dependencies
✖ 1 problem (1 error, 0 warnings)
Upvotes: 1