@wistia/eslint-config 2.1.0 → 2.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +6 -0
- package/package.json +1 -1
- package/src/configs/vitest.mjs +0 -4
- package/src/rules/vitest.mjs +32 -0
- package/test/__snapshots__/vitest.mjs.snap +24 -25
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# @wistia/eslint-config
|
|
2
2
|
|
|
3
|
+
## 2.1.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#438](https://github.com/wistia/eslint-config/pull/438) [`bd5eaaa`](https://github.com/wistia/eslint-config/commit/bd5eaaa1c65f68969a61d67871dbe177cecc94ca) Thanks [@okize](https://github.com/okize)! - fix: official vitest plugin includes formatting rules so we do not need to use `eslint-plugin-jest-formatting`
|
|
8
|
+
|
|
3
9
|
## 2.1.0
|
|
4
10
|
|
|
5
11
|
### Minor Changes
|
package/package.json
CHANGED
package/src/configs/vitest.mjs
CHANGED
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import globalsVitest from 'globals-vitest';
|
|
2
2
|
import vitestPlugin from '@vitest/eslint-plugin';
|
|
3
|
-
import jestFormattingPlugin from 'eslint-plugin-jest-formatting';
|
|
4
3
|
import noOnlyTestsPlugin from 'eslint-plugin-no-only-tests';
|
|
5
4
|
import vitestRules from '../rules/vitest.mjs';
|
|
6
|
-
import jestFormattingRules from '../rules/jest-formatting.mjs';
|
|
7
5
|
|
|
8
6
|
export default [
|
|
9
7
|
{
|
|
@@ -16,12 +14,10 @@ export default [
|
|
|
16
14
|
},
|
|
17
15
|
plugins: {
|
|
18
16
|
vitest: vitestPlugin,
|
|
19
|
-
'jest-formatting': jestFormattingPlugin,
|
|
20
17
|
'no-only-tests': noOnlyTestsPlugin,
|
|
21
18
|
},
|
|
22
19
|
rules: {
|
|
23
20
|
...vitestRules,
|
|
24
|
-
...jestFormattingRules,
|
|
25
21
|
},
|
|
26
22
|
},
|
|
27
23
|
];
|
package/src/rules/vitest.mjs
CHANGED
|
@@ -113,6 +113,38 @@ export default {
|
|
|
113
113
|
// https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/no-test-return-statement.md
|
|
114
114
|
'vitest/no-test-return-statement': 'error',
|
|
115
115
|
|
|
116
|
+
// This rule enforces a line of padding before and after 1 or more `afterAll` statements.
|
|
117
|
+
// https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/padding-around-after-all-blocks.md
|
|
118
|
+
'vitest/padding-around-after-all-blocks': 'error',
|
|
119
|
+
|
|
120
|
+
// This rule enforces a line of padding before and after 1 or more `afterEach` statements.
|
|
121
|
+
// https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/padding-around-after-each-blocks.md
|
|
122
|
+
'vitest/padding-around-after-each-blocks': 'error',
|
|
123
|
+
|
|
124
|
+
// This rule enforces a line of padding before and after `beforeAll` statements.
|
|
125
|
+
// https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/padding-around-before-all-blocks.md
|
|
126
|
+
'vitest/padding-around-before-all-blocks': 'error',
|
|
127
|
+
|
|
128
|
+
// This rule enforces a line of padding before and after 1 or more `beforeEach` statements
|
|
129
|
+
// https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/padding-around-before-each-blocks.md
|
|
130
|
+
'vitest/padding-around-before-each-blocks': 'error',
|
|
131
|
+
|
|
132
|
+
// This rule enforces a line of padding before and after 1 or more `expect` statements
|
|
133
|
+
// https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/padding-around-expect-groups.md
|
|
134
|
+
'vitest/padding-around-expect-groups': 'error',
|
|
135
|
+
|
|
136
|
+
// This rule enforces a line of padding before and after 1 or more `describe` statements
|
|
137
|
+
// https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/padding-around-describe-blocks.md
|
|
138
|
+
'vitest/padding-around-describe-blocks': 'error',
|
|
139
|
+
|
|
140
|
+
// This rule enforces a line of padding before and after 1 or more `test`/`it` statements
|
|
141
|
+
// https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/padding-around-test-blocks.md
|
|
142
|
+
'vitest/padding-around-test-blocks': 'error',
|
|
143
|
+
|
|
144
|
+
// This is a meta rule that simply enables all of the previous rules
|
|
145
|
+
// https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/padding-around-all.md
|
|
146
|
+
'vitest/padding-around-all': 'off',
|
|
147
|
+
|
|
116
148
|
// Suggest using toBeCalledWith() or toHaveBeenCalledWith()
|
|
117
149
|
// https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/prefer-called-with.md
|
|
118
150
|
'vitest/prefer-called-with': 'error',
|
|
@@ -36,34 +36,9 @@
|
|
|
36
36
|
"plugins": [
|
|
37
37
|
"@",
|
|
38
38
|
"vitest:vitest@1.6.13",
|
|
39
|
-
"jest-formatting",
|
|
40
39
|
"no-only-tests",
|
|
41
40
|
],
|
|
42
41
|
"rules": {
|
|
43
|
-
"jest-formatting/padding-around-after-all-blocks": [
|
|
44
|
-
2,
|
|
45
|
-
],
|
|
46
|
-
"jest-formatting/padding-around-after-each-blocks": [
|
|
47
|
-
2,
|
|
48
|
-
],
|
|
49
|
-
"jest-formatting/padding-around-all": [
|
|
50
|
-
0,
|
|
51
|
-
],
|
|
52
|
-
"jest-formatting/padding-around-before-all-blocks": [
|
|
53
|
-
2,
|
|
54
|
-
],
|
|
55
|
-
"jest-formatting/padding-around-before-each-blocks": [
|
|
56
|
-
2,
|
|
57
|
-
],
|
|
58
|
-
"jest-formatting/padding-around-describe-blocks": [
|
|
59
|
-
2,
|
|
60
|
-
],
|
|
61
|
-
"jest-formatting/padding-around-expect-groups": [
|
|
62
|
-
2,
|
|
63
|
-
],
|
|
64
|
-
"jest-formatting/padding-around-test-blocks": [
|
|
65
|
-
2,
|
|
66
|
-
],
|
|
67
42
|
"no-only-tests/no-only-tests": [
|
|
68
43
|
2,
|
|
69
44
|
],
|
|
@@ -174,6 +149,30 @@
|
|
|
174
149
|
"vitest/no-test-return-statement": [
|
|
175
150
|
2,
|
|
176
151
|
],
|
|
152
|
+
"vitest/padding-around-after-all-blocks": [
|
|
153
|
+
2,
|
|
154
|
+
],
|
|
155
|
+
"vitest/padding-around-after-each-blocks": [
|
|
156
|
+
2,
|
|
157
|
+
],
|
|
158
|
+
"vitest/padding-around-all": [
|
|
159
|
+
0,
|
|
160
|
+
],
|
|
161
|
+
"vitest/padding-around-before-all-blocks": [
|
|
162
|
+
2,
|
|
163
|
+
],
|
|
164
|
+
"vitest/padding-around-before-each-blocks": [
|
|
165
|
+
2,
|
|
166
|
+
],
|
|
167
|
+
"vitest/padding-around-describe-blocks": [
|
|
168
|
+
2,
|
|
169
|
+
],
|
|
170
|
+
"vitest/padding-around-expect-groups": [
|
|
171
|
+
2,
|
|
172
|
+
],
|
|
173
|
+
"vitest/padding-around-test-blocks": [
|
|
174
|
+
2,
|
|
175
|
+
],
|
|
177
176
|
"vitest/prefer-called-with": [
|
|
178
177
|
2,
|
|
179
178
|
],
|