diff --git a/packages/eslint-plugin/docs/rules/array-type.md b/packages/eslint-plugin/docs/rules/array-type.md index 60a8d612d06..8906f0c9a4c 100644 --- a/packages/eslint-plugin/docs/rules/array-type.md +++ b/packages/eslint-plugin/docs/rules/array-type.md @@ -23,15 +23,15 @@ Always use `T[]` or `readonly T[]` for all array types. Incorrect code for `"array"`: ```ts -const x: Array = ["a", "b"]; -const y: ReadonlyArray = ["a", "b"]; +const x: Array = ['a', 'b']; +const y: ReadonlyArray = ['a', 'b']; ``` Correct code for `"array"`: ```ts -const x: string[] = ["a", "b"]; -const y: readonly string[] = ["a", "b"]; +const x: string[] = ['a', 'b']; +const y: readonly string[] = ['a', 'b']; ``` ### `"generic"` @@ -41,15 +41,15 @@ Always use `Array` or `ReadonlyArray` for all array types. Incorrect code for `"generic"`: ```ts -const x: string[] = ["a", "b"]; -const y: readonly string[] = ["a", "b"]; +const x: string[] = ['a', 'b']; +const y: readonly string[] = ['a', 'b']; ``` Correct code for `"generic"`: ```ts -const x: Array = ["a", "b"]; -const y: ReadonlyArray = ["a", "b"]; +const x: Array = ['a', 'b']; +const y: ReadonlyArray = ['a', 'b']; ``` ### `"array-simple"` @@ -60,23 +60,23 @@ Use `Array` or `ReadonlyArray` for all other types (union types, intersect Incorrect code for `"array-simple"`: ```ts -const a: (string | number)[] = ["a", "b"]; -const b: ({ prop: string })[] = [{ prop: "a" }]; +const a: (string | number)[] = ['a', 'b']; +const b: ({ prop: string })[] = [{ prop: 'a' }]; const c: (() => void)[] = [() => {}]; -const d: Array = ["a", "b"]; -const e: Array = ["a", "b"]; -const f: ReadonlyArray = ["a", "b"]; +const d: Array = ['a', 'b']; +const e: Array = ['a', 'b']; +const f: ReadonlyArray = ['a', 'b']; ``` Correct code for `"array-simple"`: ```ts -const a: Array = ["a", "b"]; -const b: Array<{ prop: string }> = [{ prop: "a" }]; +const a: Array = ['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"]; +const d: MyType[] = ['a', 'b']; +const e: string[] = ['a', 'b']; +const f: readonly string[] = ['a', 'b']; ``` ## Related to