I have a classic pnpm monopero with two packages: a
and b
.
The package a
has the eslint
package as a dependency.
The package b
has not.
The problem is that when you are in the b
package folder and run pnpm exec eslint
there are no errors and pnpm used eslint
from the package a
.
This happens because by default pnpm hoists any packages with "eslint" in the name. It is done because eslint's plugin system doesn't work well with pnpm if the packages are not hoisted.
If you don't want this behavior, you can change the value of public-hoist-pattern by adding an .npmrc
in the root of your monorepo:
public-hoist-pattern[]=