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 looks at "devDependencies" instead of "peerDependencies". By adding the "optional" option the rule also looks at "optionalDependencies".

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