Skip to content

Commit 44677b4

Browse files
committed
docs(eslint-plugin): format array-type docs
1 parent 44b099d commit 44677b4

File tree

1 file changed

+18
-18
lines changed

1 file changed

+18
-18
lines changed

packages/eslint-plugin/docs/rules/array-type.md

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -23,15 +23,15 @@ Always use `T[]` or `readonly T[]` for all array types.
2323
Incorrect code for `"array"`:
2424

2525
```ts
26-
const x: Array<string> = ["a", "b"];
27-
const y: ReadonlyArray<string> = ["a", "b"];
26+
const x: Array<string> = ['a', 'b'];
27+
const y: ReadonlyArray<string> = ['a', 'b'];
2828
```
2929

3030
Correct code for `"array"`:
3131

3232
```ts
33-
const x: string[] = ["a", "b"];
34-
const y: readonly string[] = ["a", "b"];
33+
const x: string[] = ['a', 'b'];
34+
const y: readonly string[] = ['a', 'b'];
3535
```
3636

3737
### `"generic"`
@@ -41,15 +41,15 @@ Always use `Array<T>` or `ReadonlyArray<T>` for all array types.
4141
Incorrect code for `"generic"`:
4242

4343
```ts
44-
const x: string[] = ["a", "b"];
45-
const y: readonly string[] = ["a", "b"];
44+
const x: string[] = ['a', 'b'];
45+
const y: readonly string[] = ['a', 'b'];
4646
```
4747

4848
Correct code for `"generic"`:
4949

5050
```ts
51-
const x: Array<string> = ["a", "b"];
52-
const y: ReadonlyArray<string> = ["a", "b"];
51+
const x: Array<string> = ['a', 'b'];
52+
const y: ReadonlyArray<string> = ['a', 'b'];
5353
```
5454

5555
### `"array-simple"`
@@ -60,23 +60,23 @@ Use `Array<T>` or `ReadonlyArray<T>` for all other types (union types, intersect
6060
Incorrect code for `"array-simple"`:
6161

6262
```ts
63-
const a: (string | number)[] = ["a", "b"];
64-
const b: ({ prop: string })[] = [{ prop: "a" }];
63+
const a: (string | number)[] = ['a', 'b'];
64+
const b: ({ prop: string })[] = [{ prop: 'a' }];
6565
const c: (() => void)[] = [() => {}];
66-
const d: Array<MyType> = ["a", "b"];
67-
const e: Array<string> = ["a", "b"];
68-
const f: ReadonlyArray<string> = ["a", "b"];
66+
const d: Array<MyType> = ['a', 'b'];
67+
const e: Array<string> = ['a', 'b'];
68+
const f: ReadonlyArray<string> = ['a', 'b'];
6969
```
7070

7171
Correct code for `"array-simple"`:
7272

7373
```ts
74-
const a: Array<string | number> = ["a", "b"];
75-
const b: Array<{ prop: string }> = [{ prop: "a" }];
74+
const a: Array<string | number> = ['a', 'b'];
75+
const b: Array<{ prop: string }> = [{ prop: 'a' }];
7676
const c: Array<() => void> = [() => {}];
77-
const d: MyType[] = ["a", "b"];
78-
const e: string[] = ["a", "b"];
79-
const f: readonly string[] = ["a", "b"];
77+
const d: MyType[] = ['a', 'b'];
78+
const e: string[] = ['a', 'b'];
79+
const f: readonly string[] = ['a', 'b'];
8080
```
8181

8282
## Related to

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy