@vitest/eslint-plugin 1.0.0 → 1.0.2
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 +2 -2
- package/dist/index.cjs +10 -8
- package/dist/index.mjs +10 -8
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -46,7 +46,7 @@ Add `vitest` to the plugins section of your `.eslintrc` configuration file. You
|
|
|
46
46
|
|
|
47
47
|
```json
|
|
48
48
|
{
|
|
49
|
-
"plugins": ["vitest"]
|
|
49
|
+
"plugins": ["@vitest"]
|
|
50
50
|
}
|
|
51
51
|
```
|
|
52
52
|
|
|
@@ -69,7 +69,7 @@ If you're using old Eslint configuration, make sure to use legacy key like the f
|
|
|
69
69
|
|
|
70
70
|
```js
|
|
71
71
|
{
|
|
72
|
-
"extends": ["plugin
|
|
72
|
+
"extends": ["plugin:@vitest/legacy-recommended"] // or legacy-all
|
|
73
73
|
}
|
|
74
74
|
```
|
|
75
75
|
|
package/dist/index.cjs
CHANGED
|
@@ -24,7 +24,7 @@ function _interopNamespaceCompat(e) {
|
|
|
24
24
|
const path__namespace = /*#__PURE__*/_interopNamespaceCompat(path);
|
|
25
25
|
const ts__default = /*#__PURE__*/_interopDefaultCompat(ts);
|
|
26
26
|
|
|
27
|
-
const version = "0.
|
|
27
|
+
const version = "1.0.1";
|
|
28
28
|
|
|
29
29
|
function createEslintRule(rule) {
|
|
30
30
|
const createRule = utils.ESLintUtils.RuleCreator(
|
|
@@ -806,12 +806,14 @@ const expectExpect = createEslintRule({
|
|
|
806
806
|
}
|
|
807
807
|
},
|
|
808
808
|
"Program:exit"() {
|
|
809
|
-
unchecked.
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
809
|
+
const isActuallyNotValid = unchecked.filter((node) => node.arguments.some((arg) => arg.type === utils.AST_NODE_TYPES.Literal && arg.value === "assert"));
|
|
810
|
+
if (!isActuallyNotValid.length)
|
|
811
|
+
unchecked.forEach((node) => {
|
|
812
|
+
context.report({
|
|
813
|
+
node: node.callee,
|
|
814
|
+
messageId: "noAssertions"
|
|
815
|
+
});
|
|
813
816
|
});
|
|
814
|
-
});
|
|
815
817
|
}
|
|
816
818
|
};
|
|
817
819
|
}
|
|
@@ -4425,11 +4427,11 @@ const createConfig = (rules) => Object.keys(rules).reduce((acc, ruleName) => {
|
|
|
4425
4427
|
};
|
|
4426
4428
|
}, {});
|
|
4427
4429
|
const createConfigLegacy = (rules) => ({
|
|
4428
|
-
plugins: ["vitest"],
|
|
4430
|
+
plugins: ["@vitest"],
|
|
4429
4431
|
rules: Object.keys(rules).reduce((acc, ruleName) => {
|
|
4430
4432
|
return {
|
|
4431
4433
|
...acc,
|
|
4432
|
-
[
|
|
4434
|
+
[`@vitest/${ruleName}`]: rules[ruleName]
|
|
4433
4435
|
};
|
|
4434
4436
|
}, {})
|
|
4435
4437
|
});
|
package/dist/index.mjs
CHANGED
|
@@ -5,7 +5,7 @@ import ts from 'typescript';
|
|
|
5
5
|
import { fileURLToPath } from 'node:url';
|
|
6
6
|
import { createRequire } from 'node:module';
|
|
7
7
|
|
|
8
|
-
const version = "0.
|
|
8
|
+
const version = "1.0.1";
|
|
9
9
|
|
|
10
10
|
function createEslintRule(rule) {
|
|
11
11
|
const createRule = ESLintUtils.RuleCreator(
|
|
@@ -787,12 +787,14 @@ const expectExpect = createEslintRule({
|
|
|
787
787
|
}
|
|
788
788
|
},
|
|
789
789
|
"Program:exit"() {
|
|
790
|
-
unchecked.
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
790
|
+
const isActuallyNotValid = unchecked.filter((node) => node.arguments.some((arg) => arg.type === AST_NODE_TYPES.Literal && arg.value === "assert"));
|
|
791
|
+
if (!isActuallyNotValid.length)
|
|
792
|
+
unchecked.forEach((node) => {
|
|
793
|
+
context.report({
|
|
794
|
+
node: node.callee,
|
|
795
|
+
messageId: "noAssertions"
|
|
796
|
+
});
|
|
794
797
|
});
|
|
795
|
-
});
|
|
796
798
|
}
|
|
797
799
|
};
|
|
798
800
|
}
|
|
@@ -4406,11 +4408,11 @@ const createConfig = (rules) => Object.keys(rules).reduce((acc, ruleName) => {
|
|
|
4406
4408
|
};
|
|
4407
4409
|
}, {});
|
|
4408
4410
|
const createConfigLegacy = (rules) => ({
|
|
4409
|
-
plugins: ["vitest"],
|
|
4411
|
+
plugins: ["@vitest"],
|
|
4410
4412
|
rules: Object.keys(rules).reduce((acc, ruleName) => {
|
|
4411
4413
|
return {
|
|
4412
4414
|
...acc,
|
|
4413
|
-
[
|
|
4415
|
+
[`@vitest/${ruleName}`]: rules[ruleName]
|
|
4414
4416
|
};
|
|
4415
4417
|
}, {})
|
|
4416
4418
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vitest/eslint-plugin",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.2",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "Eslint plugin for vitest",
|
|
6
6
|
"repository": "vitest-dev/eslint-plugin-vitest",
|
|
@@ -36,12 +36,12 @@
|
|
|
36
36
|
"@typescript-eslint/eslint-plugin": "8.0.0",
|
|
37
37
|
"@typescript-eslint/parser": "8.0.0",
|
|
38
38
|
"@typescript-eslint/rule-tester": "8.0.0",
|
|
39
|
+
"@vitest/eslint-plugin": "^1.0.0",
|
|
39
40
|
"bumpp": "^9.4.2",
|
|
40
41
|
"concurrently": "^8.2.2",
|
|
41
42
|
"eslint": "^9.9.0",
|
|
42
43
|
"eslint-doc-generator": "^1.7.1",
|
|
43
44
|
"eslint-plugin-eslint-plugin": "^6.2.0",
|
|
44
|
-
"eslint-plugin-vitest": "^0.5.4",
|
|
45
45
|
"eslint-remote-tester": "^4.0.1",
|
|
46
46
|
"eslint-remote-tester-repositories": "^1.0.1",
|
|
47
47
|
"importx": "^0.3.11",
|
|
@@ -51,10 +51,10 @@
|
|
|
51
51
|
"vitest": "^1.6.0"
|
|
52
52
|
},
|
|
53
53
|
"peerDependencies": {
|
|
54
|
+
"@typescript-eslint/utils": ">= 8.0",
|
|
54
55
|
"eslint": ">= 8.57.0",
|
|
55
56
|
"typescript": ">= 5.0.0",
|
|
56
|
-
"vitest": "*"
|
|
57
|
-
"@typescript-eslint/utils": ">= 7.8 || 8.0.0"
|
|
57
|
+
"vitest": "*"
|
|
58
58
|
},
|
|
59
59
|
"peerDependenciesMeta": {
|
|
60
60
|
"vitest": {
|