> For AI agents: the complete documentation index is available at https://rslint.rs/llms.txt, the full documentation bundle is available at https://rslint.rs/llms-full.txt.

# array-type

[Added in v0.1.4](https://github.com/web-infra-dev/rslint/releases/tag/v0.1.4)
## Configuration

| Preset                            | Configured Value |
| --------------------------------- | ---------------- |
| ✅ ts.configs.stylistic            | `"error"`        |
| ✅ ts.configs.stylisticTypeChecked | `"error"`        |


```ts title=rslint.config.ts
import { defineConfig, ts } from '@rslint/core';

export default defineConfig([
  ts.configs.recommended,
  {
    rules: {
      '@typescript-eslint/array-type': 'error',
    },
  },
]);
```

## Rule Details

Require consistently using either `T[]` or `Array<T>` for arrays. TypeScript provides two equivalent ways to define array types. This rule enforces a consistent style across the codebase.

The rule supports three modes via the `default` option: `"array"` (prefer `T[]`), `"generic"` (prefer `Array<T>`), and `"array-simple"` (prefer `T[]` for simple types, `Array<T>` for complex types). A separate `readonly` option controls readonly array syntax.

Examples of **incorrect** code for this rule (with default `"array"` option):

```typescript
const a: Array<string> = [];
const b: ReadonlyArray<number> = [1, 2];
const c: Array<string | number> = [];
```

Examples of **correct** code for this rule (with default `"array"` option):

```typescript
const a: string[] = [];
const b: readonly number[] = [1, 2];
const c: (string | number)[] = [];
```

## Original Documentation

- [typescript-eslint: array-type](https://typescript-eslint.io/rules/array-type)
- [Source code](https://github.com/typescript-eslint/typescript-eslint/blob/v8.39.0/packages/eslint-plugin/src/rules/array-type.ts)
