# array-type

Rule `typescript/array-type`. Require consistently using either `T[]` or `Array<T>` for arrays

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

## Linters

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

## Code examples

### Incorrect: the rule reports this

```ts
const x: Array<string> = ['a', 'b'];
const y: ReadonlyArray<string> = ['a', 'b'];
```

```ts
const x: string[] = ['a', 'b'];
const y: readonly string[] = ['a', 'b'];
const z: Readonly<string[]> = ['a', 'b'];
```

```ts
const a: (string | number)[] = ['a', 'b'];
const b: { prop: string }[] = [{ prop: 'a' }];
const c: (() => void)[] = [() => {}];
const d: Array<MyType> = ['a', 'b'];
const e: Array<string> = ['a', 'b'];
const f: ReadonlyArray<string> = ['a', 'b'];
```

### Correct: the rule accepts this

```ts
const x: string[] = ['a', 'b'];
const y: readonly string[] = ['a', 'b'];
```

```ts
const x: Array<string> = ['a', 'b'];
const y: ReadonlyArray<string> = ['a', 'b'];
const z: Readonly<Array<string>> = ['a', 'b'];
```

```ts
const a: Array<string | number> = ['a', 'b'];
const b: Array<{ prop: string }> = [{ prop: 'a' }];
const c: Array<() => void> = [() => {}];
const d: MyType[] = ['a', 'b'];
const e: string[] = ['a', 'b'];
const f: readonly string[] = ['a', 'b'];
```

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/array-type": "error",
    },
  },
];
```

### Oxlint: `.oxlintrc.json`

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

### Biome: `biome.json`

```json
{
  "linter": {
    "rules": {
      "style": {
        "useConsistentArrayType": "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% |
| [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% |

## Related rules

- [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
- [typescript/no-mixed-enums](https://lintradar.dev/rules/typescript/no-mixed-enums.md): Disallow enums from having both number and string members
- [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/no-unnecessary-template-expression](https://lintradar.dev/rules/typescript/no-unnecessary-template-expression.md): Disallow unnecessary template expressions
- [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/no-unsafe-return](https://lintradar.dev/rules/typescript/no-unsafe-return.md): Disallow returning a value with type `any` from a function

---

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