Skip to content

Commit 2c754ab

Browse files
authored
Fix ESLint configuration comments in docs (#2761)
1 parent ba8a125 commit 2c754ab

21 files changed

+41
-41
lines changed

docs/rules/no-array-reduce.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,13 +80,13 @@ Allow simple operations (like addition, subtraction, etc.) in a `reduce` call.
8080
Set it to `false` to disable reduce completely.
8181

8282
```js
83-
// eslint unicorn/no-array-reduce: ["error", {"allowSimpleOperations": true}]
83+
/* eslint unicorn/no-array-reduce: ["error", {"allowSimpleOperations": true}] */
8484
//
8585
array.reduce((total, item) => total + item)
8686
```
8787

8888
```js
89-
// eslint unicorn/no-array-reduce: ["error", {"allowSimpleOperations": false}]
89+
/* eslint unicorn/no-array-reduce: ["error", {"allowSimpleOperations": false}] */
9090
//
9191
array.reduce((total, item) => total + item)
9292
```

docs/rules/no-array-reverse.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ This rule allows `array.reverse()` to be used as an expression statement by defa
3434
Pass `allowExpressionStatement: false` to forbid `Array#reverse()` even if it's an expression statement.
3535

3636
```js
37-
// eslint unicorn/no-array-reverse: ["error", {"allowExpressionStatement": false}]
37+
/* eslint unicorn/no-array-reverse: ["error", {"allowExpressionStatement": false}] */
3838
//
3939
array.reverse();
4040
```

docs/rules/no-array-sort.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ This rule allows `array.sort()` to be used as an expression statement by default
5050
Pass `allowExpressionStatement: false` to forbid `Array#sort()` even if it's an expression statement.
5151

5252
```js
53-
// eslint unicorn/no-array-sort: ["error", {"allowExpressionStatement": false}]
53+
/* eslint unicorn/no-array-sort: ["error", {"allowExpressionStatement": false}] */
5454
//
5555
array.sort();
5656
```

docs/rules/no-keyword-prefix.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ const fooNew = 'foo';
3636
If you want a custom list of disallowed prefixes you can set them with `disallowedPrefixes`:
3737

3838
```js
39-
// eslint unicorn/no-keyword-prefix: ["error", {"disallowedPrefixes": ["new", "for"]}]
39+
/* eslint unicorn/no-keyword-prefix: ["error", {"disallowedPrefixes": ["new", "for"]}] */
4040
//
4141
const classFoo = "a";
4242

@@ -51,13 +51,13 @@ The default is `["new", "class"]`.
5151
If you want to disable this rule for properties, set `checkProperties` to `false`:
5252

5353
```js
54-
// eslint unicorn/no-keyword-prefix: ["error", {"checkProperties": true}]
54+
/* eslint unicorn/no-keyword-prefix: ["error", {"checkProperties": true}] */
5555
//
5656
foo.newFoo = 2;
5757
```
5858

5959
```js
60-
// eslint unicorn/no-keyword-prefix: ["error", {"checkProperties": false}]
60+
/* eslint unicorn/no-keyword-prefix: ["error", {"checkProperties": false}] */
6161
//
6262
var foo = {newFoo: 1}; // pass
6363

@@ -70,13 +70,13 @@ foo.newFoo = 2; // pass
7070
The default behavior is to check for camel case usage. If you want to disallow the prefix entirely, set `onlyCamelCase` to `false`:
7171

7272
```js
73-
// eslint unicorn/no-keyword-prefix: ["error", {"onlyCamelCase": true}]
73+
/* eslint unicorn/no-keyword-prefix: ["error", {"onlyCamelCase": true}] */
7474
//
7575
const new_foo = "foo";
7676
```
7777

7878
```js
79-
// eslint unicorn/no-keyword-prefix: ["error", {"onlyCamelCase": false}]
79+
/* eslint unicorn/no-keyword-prefix: ["error", {"onlyCamelCase": false}] */
8080
//
8181
const new_foo = "foo";
8282
```

docs/rules/no-null.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ Default: `false`
4949
Strict equality(`===`) and strict inequality(`!==`) is ignored by default.
5050

5151
```js
52-
// eslint unicorn/no-null: ["error", {"checkStrictEquality": true}]
52+
/* eslint unicorn/no-null: ["error", {"checkStrictEquality": true}] */
5353
//
5454
if (foo === null) {}
5555
```

docs/rules/no-typeof-undefined.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ The rule ignores variables not defined in the file by default.
4747
Set it to `true` to check all variables.
4848

4949
```js
50-
// eslint unicorn/no-typeof-undefined: ["error", {"checkGlobalVariables": true}]
50+
/* eslint unicorn/no-typeof-undefined: ["error", {"checkGlobalVariables": true}] */
5151

5252
//
5353
if (typeof undefinedVariable === 'undefined') {}

docs/rules/no-useless-undefined.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -104,13 +104,13 @@ Disallow the use of `undefined` at the end of function call arguments. Pass `che
104104

105105
```js
106106
//
107-
// eslint unicorn/no-useless-undefined: ["error", {"checkArguments": true}]
107+
/* eslint unicorn/no-useless-undefined: ["error", {"checkArguments": true}] */
108108
foo(bar, baz, undefined);
109109
```
110110

111111
```js
112112
//
113-
// eslint unicorn/no-useless-undefined: ["error", {"checkArguments": false}]
113+
/* eslint unicorn/no-useless-undefined: ["error", {"checkArguments": false}] */
114114
foo(bar, baz, undefined);
115115
```
116116

@@ -122,13 +122,13 @@ Default: `true`
122122
Disallow the use of `undefined` as arrow function body. Pass `checkArrowFunctionBody: false` to disable checking them.
123123

124124
```js
125-
// eslint unicorn/no-useless-undefined: ["error", {"checkArrowFunctionBody": true}]
125+
/* eslint unicorn/no-useless-undefined: ["error", {"checkArrowFunctionBody": true}] */
126126
//
127127
const foo = () => undefined;
128128
```
129129

130130
```js
131-
// eslint unicorn/no-useless-undefined: ["error", {"checkArrowFunctionBody": false}]
131+
/* eslint unicorn/no-useless-undefined: ["error", {"checkArrowFunctionBody": false}] */
132132
//
133133
const foo = () => undefined;
134134
```

docs/rules/numeric-separators-style.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ You can set it at top-level, or override for each specific number type.
7979
Example:
8080

8181
```js
82-
// eslint unicorn/numeric-separators-style: ["error", {"onlyIfContainsSeparator": true, "binary": {"onlyIfContainsSeparator": false}]
82+
/* eslint unicorn/numeric-separators-style: ["error", {"onlyIfContainsSeparator": true, "binary": {"onlyIfContainsSeparator": false}] */
8383
const number = 100000; // Pass, this number does not contain separators
8484
const binary = 0b101010001; // Fail, `binary` type don't require separators
8585
const hexadecimal = 0xD_EED_BEE_F; // Fail, it contain separators and it's incorrectly grouped
@@ -112,7 +112,7 @@ Numbers are split into 3 distinct parts:
112112
### Examples
113113

114114
```js
115-
// eslint unicorn/numeric-separators-style: ["error", {"number": {"minimumDigits": 0, "groupLength": 3}}]
115+
/* eslint unicorn/numeric-separators-style: ["error", {"number": {"minimumDigits": 0, "groupLength": 3}}] */
116116

117117
//
118118
const foo = 12345;
@@ -125,7 +125,7 @@ const foo = 123.1_000_001;
125125
```
126126

127127
```js
128-
// eslint unicorn/numeric-separators-style: ["error", {"binary": {"minimumDigits": 0, "groupLength": 4}}]
128+
/* eslint unicorn/numeric-separators-style: ["error", {"binary": {"minimumDigits": 0, "groupLength": 4}}] */
129129

130130
//
131131
const foo = 0b101010;
@@ -135,13 +135,13 @@ const foo = 0b1010_10001;
135135
```
136136

137137
```js
138-
// eslint unicorn/numeric-separators-style: ["error", {"hexadecimal": {"minimumDigits": 0, "groupLength": 2}}]
138+
/* eslint unicorn/numeric-separators-style: ["error", {"hexadecimal": {"minimumDigits": 0, "groupLength": 2}}] */
139139
//
140140
const foo = 0xA_B_CD_EF;
141141
```
142142

143143
```js
144-
// eslint unicorn/numeric-separators-style: ["error", {"number": {"minimumDigits": 0, "groupLength": 3}}]
144+
/* eslint unicorn/numeric-separators-style: ["error", {"number": {"minimumDigits": 0, "groupLength": 3}}] */
145145

146146
//
147147
const foo = 100;
@@ -154,14 +154,14 @@ const foo = 1_000_000;
154154
```
155155

156156
```js
157-
// eslint unicorn/numeric-separators-style: ["error", {"number": {"minimumDigits": 5, "groupLength": 3}}]
157+
/* eslint unicorn/numeric-separators-style: ["error", {"number": {"minimumDigits": 5, "groupLength": 3}}] */
158158

159159
//
160160
const foo = 1000;
161161
```
162162

163163
```js
164-
// eslint unicorn/numeric-separators-style: ["error", {"octal": {"minimumDigits": 0, "groupLength": 4}}]
164+
/* eslint unicorn/numeric-separators-style: ["error", {"octal": {"minimumDigits": 0, "groupLength": 4}}] */
165165

166166
//
167167
const foo = 0o7777;

docs/rules/prefer-array-find.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ Default: `true`
5050
Pass `checkFromLast: false` to disable check cases searching from last.
5151

5252
```js
53-
// eslint unicorn/prefer-array-find: ["error", {"checkFromLast": false}]
53+
/* eslint unicorn/prefer-array-find: ["error", {"checkFromLast": false}] */
5454

5555
//
5656
const item = array.filter(x => isUnicorn(x)).at(-1);

docs/rules/prefer-array-flat.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ Example:
8686
```
8787

8888
```js
89-
// eslint unicorn/prefer-array-flat: ["error", {"functions": ["utils.flat"]}]
89+
/* eslint unicorn/prefer-array-flat: ["error", {"functions": ["utils.flat"]}] */
9090
//
9191
const foo = utils.flat(bar);
9292
```

0 commit comments

Comments
 (0)