Rule: no-submodule-imports

Disallows importing any submodule.

Rationale

Submodules of some packages are treated as private APIs and the import paths may change without deprecation periods. It’s best to stick with top-level package exports.

Config

A list of whitelisted package or submodule names.

Config examples
"no-submodule-imports": true
"no-submodule-imports": [true, "rxjs", "@angular/platform-browser", "@angular/core/testing"]
Schema
{
  "type": "array",
  "items": {
    "type": "string"
  }
}