Skip to content

Commit 4aa046a

Browse files
authored
chore: patch eslint-doc-generator (#810)
1 parent 3005315 commit 4aa046a

14 files changed

+70
-44
lines changed

.github/workflows/ci.yaml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,8 @@ jobs:
3232
- name: Lint code
3333
run: pnpm lint:js
3434

35-
### Temporarily disabled, see https://github.com/vitest-dev/eslint-plugin-vitest/issues/754
36-
#- name: Lint docs
37-
# run: pnpm lint:eslint-docs
35+
- name: Lint docs
36+
run: pnpm lint:eslint-docs
3837

3938
test:
4039
name: Test (Node.js ${{ matrix.node-version }}, ${{ matrix.os.name }})

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -185,9 +185,9 @@ export default defineConfig({
185185
💭 Requires [type information](https://typescript-eslint.io/linting/typed-linting).\
186186
❌ Deprecated.
187187

188-
| Name | Description | 💼 | ⚠️ | 🚫 | 🔧 | 💡 | 💭 ||
188+
| Name                                                | Description | 💼 | ⚠️ | 🚫 | 🔧 | 💡 | 💭 ||
189189
| :----------------------------------------------------------------------------------------------------------------------- | :---------------------------------------------------------------------------------------------- | :-- | :-- | :-- | :-- | :-- | :-- | :-- |
190-
| [consistent-test-filename](docs/rules/consistent-test-filename.md) | require .spec test file pattern | | 🌐 | | | | | |
190+
| [consistent-test-filename](docs/rules/consistent-test-filename.md) | require test file pattern | | 🌐 | | | | | |
191191
| [consistent-test-it](docs/rules/consistent-test-it.md) | enforce using test or it but not both | | 🌐 | | 🔧 | | | |
192192
| [consistent-vitest-vi](docs/rules/consistent-vitest-vi.md) | enforce using vitest or vi but not both | | 🌐 | | 🔧 | | | |
193193
| [expect-expect](docs/rules/expect-expect.md) | enforce having expectation in test body || 🌐 | | | | | |
@@ -236,6 +236,7 @@ export default defineConfig({
236236
| [prefer-expect-type-of](docs/rules/prefer-expect-type-of.md) | enforce using `expectTypeOf` instead of `expect(typeof ...)` | | 🌐 | | 🔧 | | | |
237237
| [prefer-hooks-in-order](docs/rules/prefer-hooks-in-order.md) | enforce having hooks in consistent order | | 🌐 | | | | | |
238238
| [prefer-hooks-on-top](docs/rules/prefer-hooks-on-top.md) | enforce having hooks before any test cases | | 🌐 | | | | | |
239+
| [prefer-import-in-mock](docs/rules/prefer-import-in-mock.md) | prefer dynamic import in mock | | 🌐 | | 🔧 | | | |
239240
| [prefer-importing-vitest-globals](docs/rules/prefer-importing-vitest-globals.md) | enforce importing Vitest globals | | 🌐 | | 🔧 | | | |
240241
| [prefer-lowercase-title](docs/rules/prefer-lowercase-title.md) | enforce lowercase titles | | 🌐 | | 🔧 | | | |
241242
| [prefer-mock-promise-shorthand](docs/rules/prefer-mock-promise-shorthand.md) | enforce mock resolved/rejected shorthands for promises | | 🌐 | | 🔧 | | | |
@@ -261,7 +262,6 @@ export default defineConfig({
261262
| [valid-expect-in-promise](docs/rules/valid-expect-in-promise.md) | require promises that have expectations in their chain to be valid | | 🌐 | | | | | |
262263
| [valid-title](docs/rules/valid-title.md) | enforce valid titles || 🌐 | | 🔧 | | | |
263264
| [warn-todo](docs/rules/warn-todo.md) | disallow `.todo` usage | | | | | | | |
264-
| [prefer-import-in-moc](docs/rules/prefer-import-in-moc.md) | enforce dynamic import in mock || 🌐 | | 🔧 | | | |
265265

266266
<!-- end auto-generated rules list -->
267267

docs/rules/consistent-test-filename.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Require .spec test file pattern (`vitest/consistent-test-filename`)
1+
# Require test file pattern (`vitest/consistent-test-filename`)
22

33
⚠️ This rule _warns_ in the 🌐 `all` config.
44

docs/rules/hoisted-apis-on-top.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
# Enforce hoisted APIs to be on top of the file (`@vitest/hoisted-apis-on-top`)
1+
# Enforce hoisted APIs to be on top of the file (`vitest/hoisted-apis-on-top`)
2+
3+
⚠️ This rule _warns_ in the 🌐 `all` config.
24

35
💡 This rule is manually fixable by [editor suggestions](https://eslint.org/docs/latest/use/core-concepts#rule-suggestions).
46

docs/rules/padding-around-describe-blocks.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,17 +17,17 @@ its scope.
1717
Examples of **incorrect** code for this rule:
1818

1919
```js
20-
const someText = 'hoge';
21-
describe("hoge", () => {});
22-
describe('foo', () => {});
20+
const someText = 'hoge'
21+
describe('hoge', () => {})
22+
describe('foo', () => {})
2323
```
2424

2525
Examples of **correct** code for this rule:
2626

2727
```js
28-
const someText = 'hoge';
28+
const someText = 'hoge'
2929

30-
describe("hoge", () => {});
30+
describe('hoge', () => {})
3131

32-
describe('foo', () => {});
32+
describe('foo', () => {})
3333
```

docs/rules/padding-around-test-blocks.md

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -17,31 +17,31 @@ its scope.
1717
Examples of **incorrect** code for this rule:
1818

1919
```js
20-
const someText = 'hoge';
21-
test("hoge", () => {});
22-
test('foo', () => {});
20+
const someText = 'hoge'
21+
test('hoge', () => {})
22+
test('foo', () => {})
2323
```
2424

2525
```js
26-
const someText = 'hoge';
27-
it("hoge", () => {});
28-
it('foo', () => {});
26+
const someText = 'hoge'
27+
it('hoge', () => {})
28+
it('foo', () => {})
2929
```
3030

3131
Examples of **correct** code for this rule:
3232

3333
```js
34-
const someText = 'hoge';
34+
const someText = 'hoge'
3535

36-
test("hoge", () => {});
36+
test('hoge', () => {})
3737

38-
test('foo', () => {});
38+
test('foo', () => {})
3939
```
4040

4141
```js
42-
const someText = 'hoge';
42+
const someText = 'hoge'
4343

44-
it("hoge", () => {});
44+
it('hoge', () => {})
4545

46-
it('foo', () => {});
46+
it('foo', () => {})
4747
```

docs/rules/prefer-called-once.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Enforce using `toBeCalledOnce()` or `toHaveBeenCalledOnce()` (`vitest/prefer-called-once`)
22

3-
⚠️ This rule _warns_ in the 🌐 `all` config.
3+
🚫 This rule is _disabled_ in the 🌐 `all` config.
44

55
🔧 This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix).
66

docs/rules/prefer-expect-assertions.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -50,19 +50,19 @@ when this option is enabled the following code will be considered incorrect:
5050

5151
```js
5252
test('assertions first', async () => {
53-
const data = await fetchData();
54-
expect(data).toBe('peanut butter');
55-
});
53+
const data = await fetchData()
54+
expect(data).toBe('peanut butter')
55+
})
5656
```
5757

5858
To fix this, you'll need to add `expect.assertions(1)` or `expect.hasAssertions()` as the first expression:
5959

6060
```js
6161
test('assertions first', async () => {
62-
expect.assertions(1);
63-
const data = await fetchData();
64-
expect(data).toBe('peanut butter');
65-
});
62+
expect.assertions(1)
63+
const data = await fetchData()
64+
expect(data).toBe('peanut butter')
65+
})
6666
```
6767

6868
`onlyFunctionsWithExpectInLoop` (default: `false`)

docs/rules/prefer-expect-type-of.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
# Enforce using `expectTypeOf` instead of `expect(typeof ...)` (`@vitest/prefer-expect-type-of`)
1+
# Enforce using `expectTypeOf` instead of `expect(typeof ...)` (`vitest/prefer-expect-type-of`)
2+
3+
⚠️ This rule _warns_ in the 🌐 `all` config.
24

35
🔧 This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix).
46

@@ -42,4 +44,4 @@ test('type checking', () => {
4244
expectTypeOf(123n).toBeBigInt()
4345
expectTypeOf(undefined).toBeUndefined()
4446
})
45-
```
47+
```

docs/rules/prefer-import-in-mock.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Enforce using dynamic import in `mock` (`vitest/prefer-import-in-mock`)
1+
# Prefer dynamic import in mock (`vitest/prefer-import-in-mock`)
22

33
⚠️ This rule _warns_ in the 🌐 `all` config.
44

@@ -13,11 +13,11 @@ This rule enforces using a dynamic import() in vi.mock(), which improves type in
1313
The following pattern is considered a warning:
1414

1515
```js
16-
vi.mock('./path/to/module');
16+
vi.mock('./path/to/module')
1717
```
1818

1919
The following pattern is not considered a warning:
2020

2121
```js
22-
vi.mock(import('./path/to/module'));
22+
vi.mock(import('./path/to/module'))
2323
```

0 commit comments

Comments
 (0)