In example, why eslint and prettier are installed in root? #5243
-
|
In official Why eslint and prettier are not installed in |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
|
Root package.json has scripts that rely on eslint and prettier, so they need to be installed in root.
Pnpm allows you to use a package in child workspaces even if it's installed in the root workspace, but not the other way around. This works fine. However, might be preferable to also add the eslint package a second time to the eslint-config-custom workspace. While this isn't necessary, it could help other tooling identify your dependency graph more accurately. pnpm dedupes them anyway, so there's no harm in installing it in multiple workspaces. |
Beta Was this translation helpful? Give feedback.
Root package.json has scripts that rely on eslint and prettier, so they need to be installed in root.
Pnpm allows you to use a package in child workspaces even if it's installed in the root workspace, but not the other way around.
This works fine. However, might be preferable to also add the eslint package a second time to the eslint-config-custom workspace. While this isn't necessary, it could help other tooling identify your dependency graph more accurately. pnpm dedupes them anyway, so there's no harm in installing it in multiple workspaces.