Skip to content

Commit 3b6154f

Browse files
committed
docs: add readme for consistent spacing rule
1 parent e2128a1 commit 3b6154f

File tree

2 files changed

+55
-0
lines changed

2 files changed

+55
-0
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,7 @@ CLI option\
118118

119119
| Rule | Description || 🔧 | 💡 |
120120
| --------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------ | :-: | :-: | :-: |
121+
| [consistent-spacing-between-blocks](https://github.com/playwright-community/eslint-plugin-playwright/tree/main/docs/rules/consistent-spacing-between-blocks.md) | Enforce consistent spacing between test blocks || 🔧 | |
121122
| [expect-expect](https://github.com/playwright-community/eslint-plugin-playwright/tree/main/docs/rules/expect-expect.md) | Enforce assertion to be made in a test body || | |
122123
| [max-expects](https://github.com/playwright-community/eslint-plugin-playwright/tree/main/docs/rules/max-expects.md) | Enforces a maximum number assertion calls in a test body | | | |
123124
| [max-nested-describe](https://github.com/playwright-community/eslint-plugin-playwright/tree/main/docs/rules/max-nested-describe.md) | Enforces a maximum depth to nested describe calls || | |
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
# Enforce consistent spacing between test blocks (`enforce-consistent-spacing-between-blocks`)
2+
3+
Ensure that there is a consistent spacing between test blocks.
4+
5+
## Rule Details
6+
7+
Examples of **incorrect** code for this rule:
8+
9+
```javascript
10+
test('example 1', () => {
11+
expect(true).toBe(true)
12+
})
13+
test('example 2', () => {
14+
expect(true).toBe(true)
15+
})
16+
```
17+
18+
```javascript
19+
test.beforeEach(() => {})
20+
test('example 3', () => {
21+
await test.step('first', async () => {
22+
expect(true).toBe(true)
23+
})
24+
await test.step('second', async () => {
25+
expect(true).toBe(true)
26+
})
27+
})
28+
```
29+
30+
Examples of **correct** code for this rule:
31+
32+
```javascript
33+
test('example 1', () => {
34+
expect(true).toBe(true)
35+
})
36+
37+
test('example 2', () => {
38+
expect(true).toBe(true)
39+
})
40+
```
41+
42+
```javascript
43+
test.beforeEach(() => {})
44+
45+
test('example 3', () => {
46+
await test.step('first', async () => {
47+
expect(true).toBe(true)
48+
})
49+
50+
await test.step('second', async () => {
51+
expect(true).toBe(true)
52+
})
53+
})
54+
```

0 commit comments

Comments
 (0)