Enforce consistent usage of type imports.
This rule applies only to .js and .ts files.
// code-linter.json5
{
"rules": {
"@typescript-eslint/consistent-type-imports": "error"
}
} // By default, import type Foo from '...' is recommended.
import type { Foo } from 'Foo';
import type Bar from 'Bar';
export type T = Foo;
export const x: Bar = 1; // By default, import type Foo from '...' is recommended.
import { Foo } from 'Foo';
import Bar from 'Bar';
export type T = Foo;
export const x: Bar = 1; plugin:@typescript-eslint/recommended plugin:@typescript-eslint/all
For details about how to configure Code Linter check rules, see Code Linter.