You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hey, thank you very much for this awesome project ❤️
I plan to create a customized ESLint config package based on @antfu/eslint-config.
While doing so, I noticed that the existence checks for the ESLint/Prettier plugins packages (e.g. eslint-plugin-format) are not considering the module scope. Since the plugins are imported from within @antfu/eslint-config, these packages should be expected in the same scope.
my-package ← is looking here for plugins
└── my-eslint-config
├── @antfu/eslint-config
├── eslint-plugin-format ← should look here
├── prettier
└── ...
While the setup above technically works, @antfu/eslint-config wants to install the "missing" plugins when called from my-package.
Describe the bug
Hey, thank you very much for this awesome project ❤️
I plan to create a customized ESLint config package based on
@antfu/eslint-config
.While doing so, I noticed that the existence checks for the ESLint/Prettier plugins packages (e.g.
eslint-plugin-format
) are not considering the module scope. Since the plugins are imported from within@antfu/eslint-config
, these packages should be expected in the same scope.While the setup above technically works,
@antfu/eslint-config
wants to install the "missing" plugins when called frommy-package
.This is due to the fact that the function used to check the packages,
isPackageExists
fromlocal-pkg
usingmlly
, is using the current working directory as the resolving path by default: https://github.com/unjs/mlly/blob/d13b8bcfa61c23b2f3a0893942e22fa0e1b79d5b/src/resolve.ts#L98-L100Obviously, this is only an issue when the node modules are organized in a non-flat structure, like with pnpm.
Repro is based on
local-pkg
. Let me know if you'd like one for@antfu/eslint-config
instead.Reproduction
https://github.com/paescuj/is-package-exists-scope-repro
System Info
Used Package Manager
pnpm
Validations
Contributions
The text was updated successfully, but these errors were encountered: