Commit 7d9bb1b
committed
fix(linter): Update
Another part of #14743 and #16023.
This fixes up the func-names rule so it matches most other rules in the codebase that have a config struct defining the configuration object it accepts. Now it will error if provided with an invalid config, and also auto-generates proper documentation for the rule config options.
AI Disclosure: Generated using Claude Code, modified further and reviewed by me.
----
Generated docs:
````md
## Configuration
### The 1st option
type: `"always" | "as-needed" | "never"`
#### `"always"`
Requires all function expressions to have a name.
#### `"as-needed"`
Requires a name only if one is not automatically inferred.
#### `"never"`
Disallows names for function expressions.
### The 2nd option
This option is an object with the following properties:
#### generators
Configuration for generator function expressions. If not specified, uses the
primary configuration.
Accepts `always`, `as-needed`, or `never`.
Generator functions are those defined using the `function*` syntax.
```js
function* foobar(i) {
yield i;
yield i + 10;
}
```
````eslint/func-names to error on invalid rule config options, improve docs. (#18510)1 parent bffd134 commit 7d9bb1b
File tree
2 files changed
+38
-54
lines changed- crates/oxc_linter
- src/rules/eslint
- tests
2 files changed
+38
-54
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
16 | 19 | | |
17 | 20 | | |
18 | 21 | | |
19 | 22 | | |
20 | 23 | | |
21 | | - | |
| 24 | + | |
22 | 25 | | |
23 | 26 | | |
24 | 27 | | |
| |||
33 | 36 | | |
34 | 37 | | |
35 | 38 | | |
36 | | - | |
37 | | - | |
38 | | - | |
39 | | - | |
40 | | - | |
41 | | - | |
42 | | - | |
43 | | - | |
44 | | - | |
45 | | - | |
46 | | - | |
47 | | - | |
| 39 | + | |
| 40 | + | |
48 | 41 | | |
| 42 | + | |
49 | 43 | | |
50 | 44 | | |
| 45 | + | |
51 | 46 | | |
| 47 | + | |
52 | 48 | | |
53 | 49 | | |
54 | 50 | | |
55 | | - | |
56 | | - | |
57 | | - | |
58 | | - | |
59 | | - | |
60 | | - | |
61 | | - | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
62 | 76 | | |
63 | 77 | | |
64 | 78 | | |
| |||
74 | 88 | | |
75 | 89 | | |
76 | 90 | | |
77 | | - | |
78 | | - | |
79 | | - | |
80 | | - | |
81 | | - | |
82 | | - | |
83 | | - | |
84 | | - | |
85 | | - | |
86 | | - | |
87 | | - | |
88 | | - | |
89 | | - | |
90 | | - | |
91 | | - | |
92 | | - | |
93 | | - | |
94 | | - | |
95 | 91 | | |
96 | 92 | | |
97 | 93 | | |
| |||
221 | 217 | | |
222 | 218 | | |
223 | 219 | | |
224 | | - | |
| 220 | + | |
| 221 | + | |
225 | 222 | | |
226 | 223 | | |
227 | 224 | | |
228 | 225 | | |
229 | | - | |
230 | | - | |
231 | | - | |
232 | | - | |
233 | | - | |
234 | | - | |
235 | | - | |
236 | | - | |
237 | | - | |
238 | | - | |
239 | | - | |
240 | | - | |
| 226 | + | |
241 | 227 | | |
242 | 228 | | |
243 | 229 | | |
244 | 230 | | |
245 | 231 | | |
246 | | - | |
247 | | - | |
| 232 | + | |
248 | 233 | | |
249 | 234 | | |
250 | 235 | | |
| |||
Lines changed: 0 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
33 | | - | |
34 | 33 | | |
35 | 34 | | |
36 | 35 | | |
| |||
0 commit comments