Skip to content

Commit f99d6e2

Browse files
authored
docs: Add documentation for padding-around-after-all-blocks rule (#622)
* refactor: remove @ts-ignore * docs: add padding-around-after-all-blocks docs * docs: update README
1 parent 3023345 commit f99d6e2

File tree

3 files changed

+38
-5
lines changed

3 files changed

+38
-5
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,7 @@ export default [
178178
| [no-standalone-expect](docs/rules/no-standalone-expect.md) | disallow using `expect` outside of `it` or `test` blocks | | 🌐 | | | |
179179
| [no-test-prefixes](docs/rules/no-test-prefixes.md) | disallow using `test` as a prefix | | 🌐 | 🔧 | | |
180180
| [no-test-return-statement](docs/rules/no-test-return-statement.md) | disallow return statements in tests | | 🌐 | | | |
181+
| [padding-around-after-all-blocks](docs/rules/padding-around-after-all-blocks.md) | enforce padding around `afterAll` blocks | | 🌐 | 🔧 | | |
181182
| [prefer-called-with](docs/rules/prefer-called-with.md) | enforce using `toBeCalledWith()` or `toHaveBeenCalledWith()` | | 🌐 | 🔧 | | |
182183
| [prefer-comparison-matcher](docs/rules/prefer-comparison-matcher.md) | enforce using the built-in comparison matchers | | 🌐 | 🔧 | | |
183184
| [prefer-each](docs/rules/prefer-each.md) | enforce using `each` rather than manual loops | | 🌐 | | | |
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# Enforce padding around `afterAll` blocks (`vitest/padding-around-after-all-blocks`)
2+
3+
⚠️ This rule _warns_ in the 🌐 `all` config.
4+
5+
🔧 This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix).
6+
7+
<!-- end auto-generated rule header -->
8+
9+
## Rule Details
10+
11+
This rule enforces a line of padding before _and_ after 1 or more `afterAll`
12+
statements.
13+
14+
Note that it doesn't add/enforce a padding line if it's the last statement in
15+
its scope.
16+
17+
Examples of **incorrect** code for this rule:
18+
19+
```js
20+
const someText = 'hoge';
21+
afterAll(() => {});
22+
describe('foo', () => {});
23+
```
24+
25+
Examples of **correct** code for this rule:
26+
27+
```js
28+
const someText = 'hoge';
29+
30+
afterAll(() => {});
31+
32+
describe('foo', () => {});
33+
```

src/rules/no-standalone-expect.ts

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -48,15 +48,14 @@ export default createEslintRule<Options, MESSAGE_IDS>({
4848
},
4949
schema: [
5050
{
51+
type: 'object',
5152
properties: {
52-
additionaltestblockfunctions: {
53-
// @ts-ignore
53+
additionalTestBlockFunctions: {
5454
type: 'array',
55-
// @ts-ignore
56-
items: { type: `string` }
55+
items: { type: 'string' }
5756
}
5857
},
59-
additionalproperties: false
58+
additionalProperties: false
6059
}
6160
]
6261
},

0 commit comments

Comments
 (0)