# consistent-type-definitions

Rule `typescript/consistent-type-definitions`. Enforce type definitions to consistently use either `interface` or `type`

- Source: typescript
- Technologies: TypeScript
- Kind: style
- Needs type information: no
- Autofix: yes, in at least one linter
- Reach: 47.4M weekly downloads of presets that enable it
- Trend: +32.2% last quarter
- Rank: #262 by reach, #1087 by growth

## Linters

| Linter | Rule name | Recommended | Autofix | Details | Docs |
| --- | --- | --- | --- | --- | --- |
| ESLint | `@typescript-eslint/consistent-type-definitions` | no | safe | package `@typescript-eslint/eslint-plugin` | [docs](https://typescript-eslint.io/rules/consistent-type-definitions) |
| Oxlint | `typescript/consistent-type-definitions` | no | unsafe | plugin `typescript`, category style | [docs](https://oxc.rs/docs/guide/usage/linter/rules/typescript/consistent-type-definitions.html) |
| Biome | `style/useConsistentTypeDefinitions` | no | unsafe | group style, since 2.1.4 | [docs](https://biomejs.dev/linter/rules/use-consistent-type-definitions/) |

## Code examples

### Incorrect: the rule reports this

```ts
type T = { x: number };
```

```ts
interface T {
  x: number;
}
```

### Correct: the rule accepts this

```ts
type T = string;
type Foo = string | {};

interface T {
  x: number;
}
```

```ts
type T = { x: number };
```

Examples from the ESLint documentation.

## Enable it

### ESLint: `eslint.config.js`

```js
import tseslint from "typescript-eslint";

export default [
  {
    plugins: { "@typescript-eslint": tseslint.plugin },
    rules: {
      "@typescript-eslint/consistent-type-definitions": "error",
    },
  },
];
```

### Oxlint: `.oxlintrc.json`

```json
{
  "rules": {
    "typescript/consistent-type-definitions": "error"
  }
}
```

### Biome: `biome.json`

```json
{
  "linter": {
    "rules": {
      "style": {
        "useConsistentTypeDefinitions": "error"
      }
    }
  }
}
```

## Presets that enable it

| Preset | Linter | Package | Rules | Weekly downloads | Trend |
| --- | --- | --- | --- | --- | --- |
| [typescript-eslint stylistic](https://lintradar.dev/presets/typescript-eslint-stylistic.md) | ESLint | `@typescript-eslint/eslint-plugin` | 17 | 175.9M | +29.5% |
| [Ultracite for Biome](https://lintradar.dev/presets/ultracite-biome.md) | Biome | `ultracite` | 616 | 2.1M | +151.7% |
| [Ultracite for Oxlint](https://lintradar.dev/presets/ultracite-oxlint.md) | Oxlint | `ultracite` | 475 | 2.1M | +151.7% |
| [Anthony Fu's config](https://lintradar.dev/presets/antfu.md) | ESLint | `@antfu/eslint-config` | 294 | 758.7K | +49.9% |
| [XO](https://lintradar.dev/presets/xo.md) | ESLint | `eslint-config-xo` | 618 | 413K | −5.0% |
| [eslint-config-love](https://lintradar.dev/presets/love.md) | ESLint | `eslint-config-love` | 258 | 171.7K | +39.3% |
| [Alloy](https://lintradar.dev/presets/alloy.md) | ESLint | `eslint-config-alloy` | 166 | 31.4K | +32.4% |

## Related rules

- [typescript/no-dynamic-delete](https://lintradar.dev/rules/typescript/no-dynamic-delete.md): Disallow using the `delete` operator on computed key expressions
- [typescript/unified-signatures](https://lintradar.dev/rules/typescript/unified-signatures.md): Disallow two overloads that could be unified into one with a union or an optional/rest parameter
- [typescript/no-inferrable-types](https://lintradar.dev/rules/typescript/no-inferrable-types.md): Disallow explicit type declarations for variables or parameters initialized to a number, string, or boolean
- [typescript/return-await](https://lintradar.dev/rules/typescript/return-await.md): Enforce consistent awaiting of returned promises
- [typescript/prefer-for-of](https://lintradar.dev/rules/typescript/prefer-for-of.md): Enforce the use of `for-of` loop over the standard `for` loop where possible
- [typescript/class-literal-property-style](https://lintradar.dev/rules/typescript/class-literal-property-style.md): Enforce that literals on classes are exposed in a consistent style

---

Web page: https://lintradar.dev/rules/typescript/consistent-type-definitions. Data from npm and the linters' documentation, collected Dec 4, 2026. Site guide for agents: https://lintradar.dev/llms.txt
