Make sure no phantom dependencies are used in your project (phantom-dependencies/no-phantom-dependencies
)
💼 This rule is enabled in the ✅ recommended
config.
This rule aims to make sure no phantom dependencies are used in your project.
{
"rules": {
"phantom-dependencies/no-phantom-dependencies": [
"error",
{
"paths": "src",
"pkgJsonPath": "src/package.json",
"exclude": ["examples"],
"includeNodeLib": true,
"excludeFilePattern": "test.js",
"alias": {
"@": "src"
}
}
]
}
}
paths target file or directory (support glob pattern).
Default is src
pkgJsonPath package.json path.
Default is src/package.json
need exclude pkg pattern.
include node lib {fs, path, etc}.
Default is false
need exclude scan files pattern.
some alias config like @components
@apis
etc.
If you're using pnpm. then maybe you don't need to use it.