Skip to content

Latest commit

 

History

History
70 lines (45 loc) · 1.44 KB

no-phantom-dependencies.md

File metadata and controls

70 lines (45 loc) · 1.44 KB

Make sure no phantom dependencies are used in your project (phantom-dependencies/no-phantom-dependencies)

💼 This rule is enabled in the ✅ recommended config.

Rule Details

This rule aims to make sure no phantom dependencies are used in your project.

Options

{
  "rules": {
    "phantom-dependencies/no-phantom-dependencies": [
      "error",
      {
        "paths": "src",
        "pkgJsonPath": "src/package.json",
        "exclude": ["examples"],
        "includeNodeLib": true,
        "excludeFilePattern": "test.js",
        "alias": {
          "@": "src"
        }
      }
    ]
  }
}

paths

paths target file or directory (support glob pattern).

Default is src

pkgJsonPath

pkgJsonPath package.json path.

Default is src/package.json

exclude

need exclude pkg pattern.

includeNodeLib

include node lib {fs, path, etc}.

Default is false

excludeFilePattern

need exclude scan files pattern.

alias

some alias config like @components @apis etc.

When Not To Use It

If you're using pnpm. then maybe you don't need to use it.

Further Reading