Rule: no-implicit-dependencies

Disallows importing modules that are not listed as dependency in the project’s package.json

Disallows importing transient dependencies and modules installed above your package’s root directory.

Config

By default the rule looks at "dependencies" and "peerDependencies". By adding the "dev" option the rule also looks at "devDependencies". By adding the "optional" option the rule also looks at "optionalDependencies". An array of whitelisted modules can be added to skip checking their existence in package.json.

Config examples
"no-implicit-dependencies": true
"no-implicit-dependencies": [true, "dev"]
"no-implicit-dependencies": [true, "optional"]
"no-implicit-dependencies": [true, ["src", "app"]]
Schema
{
  "type": "array",
  "items": [
    {
      "type": "string",
      "enum": [
        "dev",
        "optional"
      ]
    },
    {
      "type": "array"
    }
  ],
  "minItems": 0,
  "maxItems": 3
}