---
url: /docs/guide/usage/linter/rules/import/consistent-type-specifier-style.md
---

### What it does

Enforces or bans the use of inline type-only markers for named imports.

### Why is this bad?

Mixing top-level `import type { Foo } from 'foo'` with inline `{ type Bar }`
forces readers to mentally switch contexts when scanning your imports.
Enforcing one style makes it immediately obvious which imports are types and which are value imports.

### Examples

Examples of incorrect code for the default `prefer-top-level` option:

```typescript
import { type Foo } from "Foo";
import Foo, { type Bar } from "Foo";
```

Examples of correct code for the default option:

```typescript
import type { Foo } from 'Foo';
import type Foo, { Bar } from 'Foo';
```

Examples of incorrect code for the `prefer-top-level-if-only-type-imports` option:

```typescript
import { type Foo } from "Foo";
import { type Foo, type Bar } from "Foo";
```

Examples of correct code for the `prefer-top-level-if-only-type-imports` option:

```typescript
import type { Foo } from 'Foo';
import { type Foo, someValue } from 'Foo';
import type Foo, { Bar } from 'Foo';
```

Examples of incorrect code for the `prefer-inline` option:

```typescript
import type { Foo } from 'Foo';
import type Foo, { Bar } from 'Foo';
```

Examples of correct code for the `prefer-inline` option:

```typescript
import { type Foo } from "Foo";
import Foo, { type Bar } from "Foo";
```

## Configuration

This rule accepts one of the following string values:

### `"prefer-top-level"`

Prefer `import type { Foo } from 'foo'` for type imports.

### `"prefer-inline"`

Prefer `import { type Foo } from 'foo'` for type imports.

### `"prefer-top-level-if-only-type-imports"`

Prefer `import type { Foo } from 'foo'` when all named imports are types, but allow
`import { type Foo, bar } from 'foo'` when value imports are present.

## How to use

## Version

This rule was added in v0.16.11.

## References
