Skip to content
LogoLogo

orphan-modules

Category: suspicious. Default: warn. Fixable: no. Since: 0.1.0.

What it does

Reports modules that no other module imports and that import no module.

Why is this bad?

An orphan is usually dead code that a refactor left behind.

Options

  • ignore: globs of modules that have no connection on purpose. These globs add to the built-in list: dotfiles (**/.*), declaration files (**/*.d.ts), **/tsconfig*.json and the configuration files of tools (**/*.config.*).

Configure the rule

{
  "rules": {
    "orphan-modules": "error"
  }
}

To set options, use an object: the level, then the options of the rule.