8000 docs(website): update documentation pages · thdk/typescript-eslint@4006698 · GitHub
[go: up one dir, main page]

Skip to content

Commit 4006698

Browse files
committed
docs(website): update documentation pages
1 parent 6703d77 commit 4006698

36 files changed

+229
-153
lines changed

packages/eslint-plugin/docs/rules/adjacent-overload-signatures.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ This rule aims to standardize the way overloaded members are organized.
88

99
<!--tabs-->
1010

11-
### Incorrect code
11+
### ❌ Incorrect
1212

1313
```ts
1414
declare namespace Foo {
@@ -45,7 +45,7 @@ export function bar(): void;
4545
export function foo(sn: string | number): void;
4646
```
4747

48-
### Correct code
48+
### ✅ Correct
4949

5050
```ts
5151
declare namespace Foo {

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

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,14 +35,14 @@ Always use `T[]` or `readonly T[]` for all array types.
3535

3636
<!--tabs-->
3737

38-
#### Incorrect code
38+
#### ❌ Incorrect
3939

4040
```ts
4141
const x: Array<string> = ['a', 'b'];
4242
const y: ReadonlyArray<string> = ['a', 'b'];
4343
```
4444

45-
#### Correct code
45+
#### ✅ Correct
4646

4747
```ts
4848
const x: string[] = ['a', 'b'];
@@ -55,14 +55,14 @@ Always use `Array<T>` or `ReadonlyArray<T>` for all array types.
5555

5656
<!--tabs-->
5757

58-
#### Incorrect code
58+
#### ❌ Incorrect
5959

6060
```ts
6161
const x: string[] = ['a', 'b'];
6262
const y: readonly string[] = ['a', 'b'];
6363
```
6464

65-
#### Correct code
65+
#### ✅ Correct
6666

6767
```ts
6868
const x: Array<string> = ['a', 'b'];
@@ -76,7 +76,7 @@ Use `Array<T>` or `ReadonlyArray<T>` for all other types (union types, intersect
7676

7777
<!--tabs-->
7878

79-
#### Incorrect code
79+
#### ❌ Incorrect
8080

8181
```ts
8282
const a: (string | number)[] = ['a', 'b'];
@@ -87,7 +87,7 @@ const e: Array<string> = ['a', 'b'];
8787
const f: ReadonlyArray<string> = ['a', 'b'];
8888
```
8989

90-
#### Correct code
90+
#### ✅ Correct
9191

9292
```ts
9393
const a: Array<string | number> = ['a', 'b'];

packages/eslint-plugin/docs/rules/await-thenable.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ While it is valid JavaScript to await a non-`Promise`-like value (it will resolv
99

1010
<!--tabs-->
1111

12-
### Incorrect code
12+
### ❌ Incorrect
1313

1414
```ts
1515
await 'value';
@@ -18,7 +18,7 @@ const createValue = () => 'value';
1818
await createValue();
1919
```
2020

21-
### Correct code
21+
### ✅ Correct
2222

2323
```ts
2424
await Promise.resolve('value');

packages/eslint-plugin/docs/rules/ban-ts-comment.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ A value of `true` for a particular directive means that this rule will report if
4343

4444
<!--tabs-->
4545

46-
#### Incorrect code
46+
#### ❌ Incorrect
4747

4848
```ts
4949
if (false) {
@@ -58,7 +58,7 @@ if (false) {
5858
}
5959
```
6060

61-
#### Correct code
61+
#### ✅ Correct
6262

6363
```ts
6464
if (false) {
@@ -75,7 +75,7 @@ For example, with `{ 'ts-expect-error': 'allow-with-description' }`:
7575

7676
<!--tabs-->
7777

78-
#### Incorrect code
78+
#### ❌ Incorrect
7979

8080
```ts
8181
if (false) {
@@ -88,7 +88,7 @@ if (false) {
8888
}
8989
```
9090

91-
#### Correct code
91+
#### ✅ Correct
9292

9393
```ts
9494
if (false) {
@@ -111,7 +111,7 @@ For example, with `{ 'ts-expect-error': 'allow-with-description', minimumDescrip
111111

112112
<!--tabs-->
113113

114-
#### Incorrect code
114+
#### ❌ Incorrect
115115

116116
```ts
117117
if (false) {
@@ -120,7 +120,7 @@ if (false) {
120120
}
121121
```
122122

123-
#### Correct code
123+
#### ✅ Correct
124124

125125
```ts
126126
if (false) {

packages/eslint-plugin/docs/rules/ban-tslint-comment.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ All TSLint [rule flags](https://palantir.github.io/tslint/usage/rule-flags/)
88

99
<!--tabs-->
1010

11-
### Incorrect code
11+
### ❌ Incorrect
1212

1313
```js
1414
/* tslint:disable */
@@ -20,7 +20,7 @@ someCode(); // tslint:disable-line
2020
// tslint:disable-next-line:rule1 rule2 rule3...
2121
```
2222

23-
### Correct code
23+
### ✅ Correct
2424

2525
```js
2626
// This is a comment that just happens to mention tslint

packages/eslint-plugin/docs/rules/ban-types.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ Examples of code with the default options:
135135

136136
<!--tabs-->
137137

138-
#### Incorrect code
138+
#### ❌ Incorrect
139139

140140
```ts
141141
// use lower-case primitives for consistency
@@ -155,7 +155,7 @@ const curly1: {} = 1;
155155
const curly2: {} = { a: 'string' };
156156
```
157157

158-
#### Correct code
158+
#### ✅ Correct
159159

160160
```ts
161161
// use lower-case primitives for consistency

packages/eslint-plugin/docs/rules/class-literal-property-style.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ Examples of code with the `fields` style:
1919

2020
<!--tabs-->
2121

22-
#### Incorrect code
22+
#### ❌ Incorrect
2323

2424
```ts
2525
/* eslint @typescript-eslint/class-literal-property-style: ["error", "fields"] */
@@ -35,7 +35,7 @@ class Mx {
3535
}
3636
```
3737

38-
#### Correct code
38+
#### ✅ Correct
3939

4040
```ts
4141
/* eslint @typescript-eslint/class-literal-property-style: ["error", "fields"] */
@@ -64,7 +64,7 @@ Examples of code with the `getters` style:
6464

6565
<!--tabs-->
6666

67-
#### Incorrect code
67+
#### ❌ Incorrect
6868

6969
```ts
7070
/* eslint @typescript-eslint/class-literal-property-style: ["error", "getters"] */
@@ -76,7 +76,7 @@ class Mx {
7676
}
7777
```
7878

79-
#### Correct code
79+
#### ✅ Correct
8080

8181
```ts
8282
/* eslint @typescript-eslint/class-literal-property-style: ["error", "getters"] */

packages/eslint-plugin/docs/rules/consistent-indexed-object-style.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ Examples of code with `record` option.
3939

4040
<!--tabs-->
4141

42-
#### Incorrect code
42+
#### ❌ Incorrect
4343

4444
```ts
4545
interface Foo {
@@ -51,7 +51,7 @@ type Foo = {
5151
};
5252
```
5353

54-
#### Correct code
54+
#### ✅ Correct
5555

5656
```ts
5757
type Foo = Record<string, unknown>;
@@ -63,13 +63,13 @@ Examples of code with `index-signature` option.
6363

6464
<!--tabs-->
6565

66-
#### Incorrect code
66+
#### ❌ Incorrect
6767

6868
```ts
6969
type Foo = Record<string, unknown>;
7070
```
7171

72-
#### Correct code
72+
#### ✅ Correct
7373

7474
```ts
7575
interface Foo {

packages/eslint-plugin/docs/rules/consistent-type-assertions.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ Assertions to `any` are also ignored by this option.
5454

5555
<!--tabs-->
5656

57-
##### Incorrect code
57+
##### ❌ Incorrect
5858

5959
```ts
6060
const x = { ... } as T;
@@ -64,7 +64,7 @@ function foo() {
6464
}
6565
```
6666

67-
##### Correct code
67+
##### ✅ Correct
6868

6969
```ts
7070
const x: T = { ... };
@@ -80,7 +80,7 @@ function foo(): T {
8080

8181
<!--tabs-->
8282

83-
##### Incorrect code
83+
##### ❌ Incorrect
8484

8585
```ts
8686
const x = { ... } as T;
@@ -90,7 +90,7 @@ function foo() {
9090
}
9191
```
9292

93-
##### Correct code
93+
##### ✅ Correct
9494

9595
```tsx
9696
const x: T = { ... };

packages/eslint-plugin/docs/rules/consistent-type-definitions.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,13 +38,13 @@ Examples of code with `interface` option.
3838

3939
<!--tabs-->
4040

41-
#### Incorrect code
41+
#### ❌ Incorrect
4242

4343
```ts
4444
type T = { x: number };
4545
```
4646

47-
#### Correct code
47+
#### ✅ Correct
4848

4949
```ts
5050
type T = string;
@@ -61,15 +61,15 @@ Examples of code with `type` option.
6161

6262
<!--tabs-->
6363

64-
#### Incorrect code
64+
#### ❌ Incorrect
6565

6666
```ts
6767
interface T {
6868
x: number;
6969
}
7070
```
7171

72-
#### Correct code
72+
#### ✅ Correct
7373

7474
```ts
7575
type T = { x: number };

0 commit comments

Comments
 (0)
0