Skip to content

Commit e3aab3c

Browse files
authored
refactor: Enforce schema option descriptions and align rule docs with auto-generated options blocks (#874)
* refactor: Upgrade eslint-plugin meta rules to errors for gradual resolution * feat: Add descriptions to schema properties for improved clarity * docs: update docs * refactor: fix format
1 parent 84c64b7 commit e3aab3c

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+241
-17
lines changed

docs/rules/consistent-each-for.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -78,12 +78,12 @@ test.skip.each([[1, 2]])('test', (a, b) => {
7878

7979
<!-- begin auto-generated rule options list -->
8080

81-
| Name | Type | Choices |
82-
| :--------- | :----- | :------------ |
83-
| `describe` | String | `each`, `for` |
84-
| `it` | String | `each`, `for` |
85-
| `suite` | String | `each`, `for` |
86-
| `test` | String | `each`, `for` |
81+
| Name | Description | Type | Choices |
82+
| :--------- | :------------------------------- | :----- | :------------ |
83+
| `describe` | Preferred method for `describe`. | String | `each`, `for` |
84+
| `it` | Preferred method for `it`. | String | `each`, `for` |
85+
| `suite` | Preferred method for `suite`. | String | `each`, `for` |
86+
| `test` | Preferred method for `test`. | String | `each`, `for` |
8787

8888
<!-- end auto-generated rule options list -->
8989

docs/rules/consistent-test-filename.md

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,18 @@
66

77
<!-- end auto-generated rule header -->
88

9-
### Rule Details
9+
## Rule Details
1010

11-
#### Options
11+
### Options
12+
13+
<!-- begin auto-generated rule options list -->
14+
15+
| Name | Description | Type |
16+
| :--------------- | :------------------------------------------------------- | :----- |
17+
| `allTestPattern` | Regex pattern used to identify all possible test files. | String |
18+
| `pattern` | Regex pattern for files that should be treated as tests. | String |
19+
20+
<!-- end auto-generated rule options list -->
1221

1322
```json
1423
{

docs/rules/consistent-test-it.md

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
<!-- end auto-generated rule header -->
1010

11-
### Rule Details
11+
## Rule Details
1212

1313
Examples of **incorrect** code for this rule:
1414

@@ -36,7 +36,16 @@ test('it works', () => {
3636
})
3737
```
3838

39-
#### Options
39+
### Options
40+
41+
<!-- begin auto-generated rule options list -->
42+
43+
| Name | Description | Type | Choices |
44+
| :--------------- | :------------------------------------------------- | :----- | :----------- |
45+
| `fn` | Preferred global test function keyword. | String | `test`, `it` |
46+
| `withinDescribe` | Preferred test function keyword inside `describe`. | String | `test`, `it` |
47+
48+
<!-- end auto-generated rule options list -->
4049

4150
```json
4251
{

docs/rules/consistent-vitest-vi.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,14 @@ vitest.stubEnv('NODE_ENV', 'production')
3434

3535
## Options
3636

37+
<!-- begin auto-generated rule options list -->
38+
39+
| Name | Description | Type | Choices |
40+
| :--- | :------------------------------------ | :----- | :------------- |
41+
| `fn` | Preferred utility keyword to enforce. | String | `vi`, `vitest` |
42+
43+
<!-- end auto-generated rule options list -->
44+
3745
```json
3846
{
3947
"type": "object",

docs/rules/expect-expect.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,15 @@ If you're using Vitest's [type-testing feature](https://vitest.dev/guide/testing
3535

3636
## Options
3737

38+
<!-- begin auto-generated rule options list -->
39+
40+
| Name | Description | Type |
41+
| :----------------------------- | :---------------------------------------------------------- | :------- |
42+
| `additionalTestBlockFunctions` | Additional functions that should be treated as test blocks. | String[] |
43+
| `assertFunctionNames` | List of function names treated as assertions. | String[] |
44+
45+
<!-- end auto-generated rule options list -->
46+
3847
### `assertFunctionNames`
3948

4049
```json

docs/rules/max-expects.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,14 @@ test('foo', () => {
2727

2828
### Options
2929

30+
<!-- begin auto-generated rule options list -->
31+
32+
| Name | Description | Type |
33+
| :---- | :-------------------------------------------------- | :----- |
34+
| `max` | Maximum number of `expect` calls allowed in a test. | Number |
35+
36+
<!-- end auto-generated rule options list -->
37+
3038
> Default: `5`
3139
3240
Maximum number of `expect` per test.

docs/rules/max-nested-describe.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,14 @@ describe('inner', () => {
2828

2929
## Options
3030

31+
<!-- begin auto-generated rule options list -->
32+
33+
| Name | Description | Type |
34+
| :---- | :--------------------------------------------------- | :----- |
35+
| `max` | Maximum allowed nesting depth for `describe` blocks. | Number |
36+
37+
<!-- end auto-generated rule options list -->
38+
3139
> Default: `5`
3240
3341
Maximum number of nested `describe` blocks.

docs/rules/no-conditional-expect.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,14 @@ test.for([null, expect.objectContaining({ bar: 'baz' })])(
4242

4343
## Options
4444

45+
<!-- begin auto-generated rule options list -->
46+
47+
| Name | Description | Type |
48+
| :----------------- | :--------------------------------------------------------------- | :------ |
49+
| `expectAssertions` | Enable/disable whether expect.assertions() is taken into account | Boolean |
50+
51+
<!-- end auto-generated rule options list -->
52+
4553
#### expectAssertions
4654

4755
```json

docs/rules/no-focused-tests.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,14 @@ test('it', () => {
3636

3737
### Options
3838

39+
<!-- begin auto-generated rule options list -->
40+
41+
| Name | Description | Type |
42+
| :-------- | :------------------------------------------ | :------ |
43+
| `fixable` | Whether the rule should provide an autofix. | Boolean |
44+
45+
<!-- end auto-generated rule options list -->
46+
3947
This rule has a `fixable` option that tells the plugin to automatically fix the tests for you. The option is enabled by default. You can disable it in your `eslint.config.js` file using the following configuration.
4048

4149
```ts

docs/rules/no-hooks.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,14 @@ describe('foo', () => {
9090

9191
## Options
9292

93+
<!-- begin auto-generated rule options list -->
94+
95+
| Name | Description | Type |
96+
| :------ | :---------------------------------------------------------------------- | :------- |
97+
| `allow` | This array option controls which Vitest hooks are checked by this rule. | String[] |
98+
99+
<!-- end auto-generated rule options list -->
100+
93101
```json
94102
{
95103
"vitest/no-hooks": [

0 commit comments

Comments
 (0)