Skip to content

typescript/consistent-type-imports Nursery

🛠️ An auto-fix is available for this rule for some violations.

What it does

Enforce consistent usage of type imports.

Why is this bad?

inconsistent usage of type imports can make the code harder to read and understand.

Example

ts
import { Foo } from "Foo";
type T = Foo;

type S = import("Foo");

How to use

To enable this rule in the CLI or using the config file, you can use:

bash
oxlint --deny typescript/consistent-type-imports
json
{
  "rules": {
    "typescript/consistent-type-imports": "error"
  }
}

References

Released under the MIT License.