Commit 096fb2c
authored
docs(linter): Add config option docs for 3 rules. (#15211)
Part of #14743.
- eslint/no-bitwise
- eslint/no-console
- eslint/no-inner-declarations
Generated docs:
```md
## Configuration
This rule accepts a configuration object with the following properties:
### allow
type: `string[]`
default: `[]`
The `allow` option permits the given list of console methods to be used as exceptions to
this rule.
Say the option was configured as `{ "allow": ["info"] }` then the rule would behave as
follows:
Example of **incorrect** code for this option:
\```javascript
console.log('foo');
\```
Example of **correct** code for this option:
\```javascript
console.info('foo');
\```
```
```md
## Configuration
This rule accepts a configuration object with the following properties:
### blockScopedFunctions
default: `null`
Controls whether function declarations in nested blocks are allowed in strict mode (ES6+ behavior).
### config
default: `"functions"`
Determines what type of declarations to check.
```
```md
## Configuration
This rule accepts a configuration object with the following properties:
### allow
type: `string[]`
default: `[]`
The `allow` option permits the given list of bitwise operators to be used
as exceptions to this rule.
For example `{ "allow": ["~"] }` would allow the use of the bitwise operator
`~` without restriction. Such as in the following:
\```javascript
~[1,2,3].indexOf(1) === -1;
\```
### int32Hint
type: `boolean`
default: `false`
When set to true the `int32Hint` option allows the use of bitwise OR in |0
pattern for type casting.
For example with `{ "int32Hint": true }` the following is permitted:
\```javascript
const b = a|0;
\```
```1 parent 3f393e3 commit 096fb2c
File tree
3 files changed
+60
-63
lines changed- crates/oxc_linter/src/rules/eslint
3 files changed
+60
-63
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| 6 | + | |
6 | 7 | | |
7 | 8 | | |
8 | 9 | | |
| |||
15 | 16 | | |
16 | 17 | | |
17 | 18 | | |
18 | | - | |
| 19 | + | |
| 20 | + | |
19 | 21 | | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
20 | 31 | | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
21 | 40 | | |
22 | 41 | | |
23 | 42 | | |
| |||
66 | 85 | | |
67 | 86 | | |
68 | 87 | | |
69 | | - | |
70 | | - | |
71 | | - | |
72 | | - | |
73 | | - | |
74 | | - | |
75 | | - | |
76 | | - | |
77 | | - | |
78 | | - | |
79 | | - | |
80 | | - | |
81 | | - | |
82 | | - | |
83 | | - | |
84 | | - | |
85 | | - | |
86 | | - | |
87 | | - | |
88 | | - | |
89 | | - | |
90 | | - | |
91 | | - | |
92 | | - | |
93 | | - | |
94 | | - | |
95 | | - | |
96 | | - | |
97 | | - | |
98 | 88 | | |
99 | 89 | | |
100 | | - | |
| 90 | + | |
| 91 | + | |
101 | 92 | | |
102 | 93 | | |
103 | 94 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| 5 | + | |
| 6 | + | |
5 | 7 | | |
6 | 8 | | |
7 | 9 | | |
| |||
23 | 25 | | |
24 | 26 | | |
25 | 27 | | |
26 | | - | |
| 28 | + | |
| 29 | + | |
27 | 30 | | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
28 | 46 | | |
29 | 47 | | |
30 | 48 | | |
| |||
63 | 81 | | |
64 | 82 | | |
65 | 83 | | |
66 | | - | |
67 | | - | |
68 | | - | |
69 | | - | |
70 | | - | |
71 | | - | |
72 | | - | |
73 | | - | |
74 | | - | |
75 | | - | |
76 | | - | |
77 | | - | |
78 | | - | |
79 | | - | |
80 | | - | |
81 | | - | |
82 | | - | |
83 | | - | |
84 | | - | |
85 | | - | |
86 | | - | |
87 | | - | |
88 | 84 | | |
89 | 85 | | |
90 | 86 | | |
91 | | - | |
| 87 | + | |
| 88 | + | |
92 | 89 | | |
93 | 90 | | |
94 | 91 | | |
| |||
Lines changed: 17 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| 5 | + | |
| 6 | + | |
5 | 7 | | |
6 | 8 | | |
7 | 9 | | |
| |||
11 | 13 | | |
12 | 14 | | |
13 | 15 | | |
14 | | - | |
| 16 | + | |
| 17 | + | |
15 | 18 | | |
| 19 | + | |
16 | 20 | | |
| 21 | + | |
| 22 | + | |
17 | 23 | | |
18 | 24 | | |
19 | 25 | | |
20 | | - | |
| 26 | + | |
| 27 | + | |
21 | 28 | | |
22 | | - | |
| 29 | + | |
23 | 30 | | |
24 | 31 | | |
25 | | - | |
| 32 | + | |
26 | 33 | | |
27 | 34 | | |
28 | 35 | | |
29 | | - | |
| 36 | + | |
| 37 | + | |
30 | 38 | | |
31 | | - | |
| 39 | + | |
32 | 40 | | |
33 | 41 | | |
34 | | - | |
| 42 | + | |
35 | 43 | | |
36 | 44 | | |
37 | 45 | | |
| |||
64 | 72 | | |
65 | 73 | | |
66 | 74 | | |
67 | | - | |
| 75 | + | |
| 76 | + | |
68 | 77 | | |
69 | 78 | | |
70 | 79 | | |
| |||
0 commit comments