@vitest/eslint-plugin 1.1.21 → 1.1.22
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/README.md +7 -0
- package/dist/index.cjs +9 -8
- package/dist/index.mjs +9 -8
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -178,6 +178,13 @@ export default [
|
|
|
178
178
|
| [no-standalone-expect](docs/rules/no-standalone-expect.md) | disallow using `expect` outside of `it` or `test` blocks | | 🌐 | | | |
|
|
179
179
|
| [no-test-prefixes](docs/rules/no-test-prefixes.md) | disallow using `test` as a prefix | | 🌐 | 🔧 | | |
|
|
180
180
|
| [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 | | 🌐 | 🔧 | | |
|
|
182
|
+
| [padding-around-after-each-blocks](docs/rules/padding-around-after-each-blocks.md) | enforce padding around `afterEach` blocks | | 🌐 | 🔧 | | |
|
|
183
|
+
| [padding-around-all](docs/rules/padding-around-all.md) | enforce padding around vitest functions | | 🌐 | 🔧 | | |
|
|
184
|
+
| [padding-around-before-all-blocks](docs/rules/padding-around-before-all-blocks.md) | enforce padding around `beforeAll` blocks | | 🌐 | 🔧 | | |
|
|
185
|
+
| [padding-around-before-each-blocks](docs/rules/padding-around-before-each-blocks.md) | enforce padding around `beforeEach` blocks | | 🌐 | 🔧 | | |
|
|
186
|
+
| [padding-around-describe-blocks](docs/rules/padding-around-describe-blocks.md) | enforce padding around `describe` blocks | | 🌐 | 🔧 | | |
|
|
187
|
+
| [padding-around-expect-groups](docs/rules/padding-around-expect-groups.md) | enforce padding around `expect` groups | | 🌐 | 🔧 | | |
|
|
181
188
|
| [prefer-called-with](docs/rules/prefer-called-with.md) | enforce using `toBeCalledWith()` or `toHaveBeenCalledWith()` | | 🌐 | 🔧 | | |
|
|
182
189
|
| [prefer-comparison-matcher](docs/rules/prefer-comparison-matcher.md) | enforce using the built-in comparison matchers | | 🌐 | 🔧 | | |
|
|
183
190
|
| [prefer-each](docs/rules/prefer-each.md) | enforce using `each` rather than manual loops | | 🌐 | | | |
|
package/dist/index.cjs
CHANGED
|
@@ -23,7 +23,7 @@ function _interopNamespaceCompat(e) {
|
|
|
23
23
|
const path__namespace = /*#__PURE__*/_interopNamespaceCompat(path);
|
|
24
24
|
const ts__default = /*#__PURE__*/_interopDefaultCompat(ts);
|
|
25
25
|
|
|
26
|
-
const version = "1.1.
|
|
26
|
+
const version = "1.1.21";
|
|
27
27
|
|
|
28
28
|
function createEslintRule(rule) {
|
|
29
29
|
const createRule = utils.ESLintUtils.RuleCreator(
|
|
@@ -1934,15 +1934,14 @@ const noStandaloneExpect = createEslintRule({
|
|
|
1934
1934
|
},
|
|
1935
1935
|
schema: [
|
|
1936
1936
|
{
|
|
1937
|
+
type: "object",
|
|
1937
1938
|
properties: {
|
|
1938
|
-
|
|
1939
|
-
// @ts-ignore
|
|
1939
|
+
additionalTestBlockFunctions: {
|
|
1940
1940
|
type: "array",
|
|
1941
|
-
|
|
1942
|
-
items: { type: `string` }
|
|
1941
|
+
items: { type: "string" }
|
|
1943
1942
|
}
|
|
1944
1943
|
},
|
|
1945
|
-
|
|
1944
|
+
additionalProperties: false
|
|
1946
1945
|
}
|
|
1947
1946
|
]
|
|
1948
1947
|
},
|
|
@@ -2242,7 +2241,9 @@ const validTitle = createEslintRule({
|
|
|
2242
2241
|
CallExpression(node) {
|
|
2243
2242
|
const vitestFnCall = parseVitestFnCall(node, context);
|
|
2244
2243
|
if (vitestFnCall?.type !== "describe" && vitestFnCall?.type !== "test" && vitestFnCall?.type !== "it") return;
|
|
2245
|
-
if (vitestFnCall.members.
|
|
2244
|
+
if (vitestFnCall.members && vitestFnCall.members[0] && vitestFnCall.members[0].type === utils.AST_NODE_TYPES.Identifier && vitestFnCall.members[0].name === "extend") {
|
|
2245
|
+
return;
|
|
2246
|
+
}
|
|
2246
2247
|
const [argument] = node.arguments;
|
|
2247
2248
|
if (settings.typecheck) {
|
|
2248
2249
|
const services = utils.ESLintUtils.getParserServices(context);
|
|
@@ -4520,7 +4521,7 @@ const config = [
|
|
|
4520
4521
|
];
|
|
4521
4522
|
const paddingAroundTestBlocks = createPaddingRule(
|
|
4522
4523
|
RULE_NAME$2,
|
|
4523
|
-
"Enforce padding around
|
|
4524
|
+
"Enforce padding around `test` blocks",
|
|
4524
4525
|
config
|
|
4525
4526
|
);
|
|
4526
4527
|
|
package/dist/index.mjs
CHANGED
|
@@ -4,7 +4,7 @@ import { isAbsolute, posix } from 'node:path';
|
|
|
4
4
|
import ts from 'typescript';
|
|
5
5
|
import { createRequire } from 'node:module';
|
|
6
6
|
|
|
7
|
-
const version = "1.1.
|
|
7
|
+
const version = "1.1.21";
|
|
8
8
|
|
|
9
9
|
function createEslintRule(rule) {
|
|
10
10
|
const createRule = ESLintUtils.RuleCreator(
|
|
@@ -1915,15 +1915,14 @@ const noStandaloneExpect = createEslintRule({
|
|
|
1915
1915
|
},
|
|
1916
1916
|
schema: [
|
|
1917
1917
|
{
|
|
1918
|
+
type: "object",
|
|
1918
1919
|
properties: {
|
|
1919
|
-
|
|
1920
|
-
// @ts-ignore
|
|
1920
|
+
additionalTestBlockFunctions: {
|
|
1921
1921
|
type: "array",
|
|
1922
|
-
|
|
1923
|
-
items: { type: `string` }
|
|
1922
|
+
items: { type: "string" }
|
|
1924
1923
|
}
|
|
1925
1924
|
},
|
|
1926
|
-
|
|
1925
|
+
additionalProperties: false
|
|
1927
1926
|
}
|
|
1928
1927
|
]
|
|
1929
1928
|
},
|
|
@@ -2223,7 +2222,9 @@ const validTitle = createEslintRule({
|
|
|
2223
2222
|
CallExpression(node) {
|
|
2224
2223
|
const vitestFnCall = parseVitestFnCall(node, context);
|
|
2225
2224
|
if (vitestFnCall?.type !== "describe" && vitestFnCall?.type !== "test" && vitestFnCall?.type !== "it") return;
|
|
2226
|
-
if (vitestFnCall.members.
|
|
2225
|
+
if (vitestFnCall.members && vitestFnCall.members[0] && vitestFnCall.members[0].type === AST_NODE_TYPES.Identifier && vitestFnCall.members[0].name === "extend") {
|
|
2226
|
+
return;
|
|
2227
|
+
}
|
|
2227
2228
|
const [argument] = node.arguments;
|
|
2228
2229
|
if (settings.typecheck) {
|
|
2229
2230
|
const services = ESLintUtils.getParserServices(context);
|
|
@@ -4501,7 +4502,7 @@ const config = [
|
|
|
4501
4502
|
];
|
|
4502
4503
|
const paddingAroundTestBlocks = createPaddingRule(
|
|
4503
4504
|
RULE_NAME$2,
|
|
4504
|
-
"Enforce padding around
|
|
4505
|
+
"Enforce padding around `test` blocks",
|
|
4505
4506
|
config
|
|
4506
4507
|
);
|
|
4507
4508
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vitest/eslint-plugin",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.22",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "Eslint plugin for vitest",
|
|
6
6
|
"repository": "vitest-dev/eslint-plugin-vitest",
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
"@types/node": "^22.10.2",
|
|
36
36
|
"@typescript-eslint/eslint-plugin": "8.18.2",
|
|
37
37
|
"@typescript-eslint/parser": "8.18.2",
|
|
38
|
-
"@typescript-eslint/rule-tester": "8.18.
|
|
38
|
+
"@typescript-eslint/rule-tester": "8.18.2",
|
|
39
39
|
"@vitest/eslint-plugin": "^1.1.20",
|
|
40
40
|
"bumpp": "^9.9.2",
|
|
41
41
|
"concurrently": "^9.1.1",
|