array-type
Enforce a consistent array type syntax.
Targeted pattern scopeโ
This rule targets TypeScript array type annotations.
What this rule reportsโ
This rule reports array types that do not match the configured style.
Why this rule existsโ
Mixing Array<T> and T[] makes signatures harder to scan and causes avoidable
style churn.
โ Incorrectโ
type Values = Array<string>;
โ Correctโ
type Values = string[];
Behavior and migration notesโ
This rule forwards options and behavior to @typescript-eslint/array-type.
- Lifecycle: Deprecated and frozen.
- Deprecated since:
v1.0.0 - Available until:
v2.0.0 - Use instead:
@typescript-eslint/array-type
Additional examplesโ
// with default @typescript-eslint/array-type options
type Values = Array<string>;
// โ reported
type ValuesFixed = string[];
// โ
valid
ESLint flat config exampleโ
import etcMisc from "eslint-plugin-etc-misc";
export default [
{
plugins: { "etc-misc": etcMisc },
rules: {
"etc-misc/array-type": "error",
},
},
];
When not to use itโ
Disable this rule if your project intentionally allows mixed array type styles.
Package documentationโ
Rule catalog ID: R001
Further readingโ
Adoption resourcesโ
- Start at warning level in CI, then move to error after cleanup.
- Use focused codemods/autofix batches per package or directory.