Skip to content

Commit 6cca0d3

Browse files
authored
workflow: lint test files (#5727)
1 parent e5a9089 commit 6cca0d3

File tree

3 files changed

+105
-4
lines changed

3 files changed

+105
-4
lines changed

.eslintrc.js

+4-1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ module.exports = {
66
parserOptions: {
77
sourceType: 'module'
88
},
9+
plugins: ["jest"],
910
rules: {
1011
'no-debugger': 'error',
1112
'no-unused-vars': [
@@ -32,7 +33,9 @@ module.exports = {
3233
files: ['**/__tests__/**', 'test-dts/**'],
3334
rules: {
3435
'no-restricted-globals': 'off',
35-
'no-restricted-syntax': 'off'
36+
'no-restricted-syntax': 'off',
37+
'jest/no-disabled-tests': 'error',
38+
'jest/no-focused-tests': 'error'
3639
}
3740
},
3841
// shared, may be used in any env

package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"size": "run-s size-global size-baseline",
88
"size-global": "node scripts/build.js vue runtime-dom -f global -p",
99
"size-baseline": "node scripts/build.js runtime-dom runtime-core reactivity shared -f esm-bundler && cd packages/size-check && vite build && node brotli",
10-
"lint": "eslint --ext .ts packages/*/src/**.ts",
10+
"lint": "eslint --ext .ts packages/*/{src,__tests__}/**.ts",
1111
"format": "prettier --write --parser typescript \"packages/**/*.ts?(x)\"",
1212
"test": "run-s \"test-unit {@}\" \"test-e2e {@}\"",
1313
"test-unit": "jest --filter ./scripts/filter-unit.js",
@@ -69,6 +69,7 @@
6969
"enquirer": "^2.3.2",
7070
"esbuild": "^0.14.35",
7171
"eslint": "^7.7.0",
72+
"eslint-plugin-jest": "26.1.5",
7273
"execa": "^4.0.2",
7374
"fs-extra": "^9.0.1",
7475
"jest": "^27.1.0",

pnpm-lock.yaml

+99-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)