From: Cédric Exbrayat Date: Fri, 13 May 2022 08:24:21 +0000 (+0200) Subject: workflow: lint test files (#5727) X-Git-Tag: v3.2.34-beta.1~12 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=6cca0d3b0e344eca2c102b03b7e9cb16b2fd7cbe;p=thirdparty%2Fvuejs%2Fcore.git workflow: lint test files (#5727) --- diff --git a/.eslintrc.js b/.eslintrc.js index 5528024779..8485d76f53 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -6,6 +6,7 @@ module.exports = { parserOptions: { sourceType: 'module' }, + plugins: ["jest"], rules: { 'no-debugger': 'error', 'no-unused-vars': [ @@ -32,7 +33,9 @@ module.exports = { files: ['**/__tests__/**', 'test-dts/**'], rules: { 'no-restricted-globals': 'off', - 'no-restricted-syntax': 'off' + 'no-restricted-syntax': 'off', + 'jest/no-disabled-tests': 'error', + 'jest/no-focused-tests': 'error' } }, // shared, may be used in any env diff --git a/package.json b/package.json index f426835377..063a626e15 100644 --- a/package.json +++ b/package.json @@ -7,7 +7,7 @@ "size": "run-s size-global size-baseline", "size-global": "node scripts/build.js vue runtime-dom -f global -p", "size-baseline": "node scripts/build.js runtime-dom runtime-core reactivity shared -f esm-bundler && cd packages/size-check && vite build && node brotli", - "lint": "eslint --ext .ts packages/*/src/**.ts", + "lint": "eslint --ext .ts packages/*/{src,__tests__}/**.ts", "format": "prettier --write --parser typescript \"packages/**/*.ts?(x)\"", "test": "run-s \"test-unit {@}\" \"test-e2e {@}\"", "test-unit": "jest --filter ./scripts/filter-unit.js", @@ -69,6 +69,7 @@ "enquirer": "^2.3.2", "esbuild": "^0.14.35", "eslint": "^7.7.0", + "eslint-plugin-jest": "26.1.5", "execa": "^4.0.2", "fs-extra": "^9.0.1", "jest": "^27.1.0", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 668d0e683b..680005bef3 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -26,6 +26,7 @@ importers: enquirer: ^2.3.2 esbuild: ^0.14.35 eslint: ^7.7.0 + eslint-plugin-jest: 26.1.5 execa: ^4.0.2 fs-extra: ^9.0.1 jest: ^27.1.0 @@ -74,6 +75,7 @@ importers: enquirer: 2.3.6 esbuild: 0.14.35 eslint: 7.32.0 + eslint-plugin-jest: 26.1.5_kkaclaimgki2r45yqzc3bxhmwy execa: 4.1.0 fs-extra: 9.1.0 jest: 27.4.4 @@ -1145,6 +1147,10 @@ packages: pretty-format: 27.4.2 dev: true + /@types/json-schema/7.0.11: + resolution: {integrity: sha512-wOuvG1SN4Us4rez+tylwwwCV1psiNVOkJeM3AUWUNWg/jDQY2+HE/444y5gc+jBmRqASOm2Oeh5c1axHobwRKQ==} + dev: true + /@types/lru-cache/5.1.1: resolution: {integrity: sha512-ssE3Vlrys7sdIzs5LOxCzTVMsU7i9oa/IaW92wF32JFb3CVczqOkru2xspuKczHEbG3nvmPY7IFqVmGGHdNbYw==} dev: true @@ -1227,6 +1233,14 @@ packages: - supports-color dev: true + /@typescript-eslint/scope-manager/5.19.0: + resolution: {integrity: sha512-Fz+VrjLmwq5fbQn5W7cIJZ066HxLMKvDEmf4eu1tZ8O956aoX45jAuBB76miAECMTODyUxH61AQM7q4/GOMQ5g==} + engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + dependencies: + '@typescript-eslint/types': 5.19.0 + '@typescript-eslint/visitor-keys': 5.19.0 + dev: true + /@typescript-eslint/scope-manager/5.23.0: resolution: {integrity: sha512-EhjaFELQHCRb5wTwlGsNMvzK9b8Oco4aYNleeDlNuL6qXWDF47ch4EhVNPh8Rdhf9tmqbN4sWDk/8g+Z/J8JVw==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} @@ -1235,11 +1249,37 @@ packages: '@typescript-eslint/visitor-keys': 5.23.0 dev: true + /@typescript-eslint/types/5.19.0: + resolution: {integrity: sha512-zR1ithF4Iyq1wLwkDcT+qFnhs8L5VUtjgac212ftiOP/ZZUOCuuF2DeGiZZGQXGoHA50OreZqLH5NjDcDqn34w==} + engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + dev: true + /@typescript-eslint/types/5.23.0: resolution: {integrity: sha512-NfBsV/h4dir/8mJwdZz7JFibaKC3E/QdeMEDJhiAE3/eMkoniZ7MjbEMCGXw6MZnZDMN3G9S0mH/6WUIj91dmw==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} dev: true + /@typescript-eslint/typescript-estree/5.19.0_typescript@4.6.4: + resolution: {integrity: sha512-dRPuD4ocXdaE1BM/dNR21elSEUPKaWgowCA0bqJ6YbYkvtrPVEvZ+zqcX5a8ECYn3q5iBSSUcBBD42ubaOp0Hw==} + engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + peerDependencies: + typescript: '*' + peerDependenciesMeta: + typescript: + optional: true + dependencies: + '@typescript-eslint/types': 5.19.0 + '@typescript-eslint/visitor-keys': 5.19.0 + debug: 4.3.3 + globby: 11.0.4 + is-glob: 4.0.3 + semver: 7.3.5 + tsutils: 3.21.0_typescript@4.6.4 + typescript: 4.6.4 + transitivePeerDependencies: + - supports-color + dev: true + /@typescript-eslint/typescript-estree/5.23.0_typescript@4.6.4: resolution: {integrity: sha512-xE9e0lrHhI647SlGMl+m+3E3CKPF1wzvvOEWnuE3CCjjT7UiRnDGJxmAcVKJIlFgK6DY9RB98eLr1OPigPEOGg==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} @@ -1261,6 +1301,32 @@ packages: - supports-color dev: true + /@typescript-eslint/utils/5.19.0_e4zyhrvfnqudwdx5bevnvkluy4: + resolution: {integrity: sha512-ZuEckdupXpXamKvFz/Ql8YnePh2ZWcwz7APICzJL985Rp5C2AYcHO62oJzIqNhAMtMK6XvrlBTZeNG8n7gS3lQ==} + engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + peerDependencies: + eslint: ^6.0.0 || ^7.0.0 || ^8.0.0 + dependencies: + '@types/json-schema': 7.0.11 + '@typescript-eslint/scope-manager': 5.19.0 + '@typescript-eslint/types': 5.19.0 + '@typescript-eslint/typescript-estree': 5.19.0_typescript@4.6.4 + eslint: 7.32.0 + eslint-scope: 5.1.1 + eslint-utils: 3.0.0_eslint@7.32.0 + transitivePeerDependencies: + - supports-color + - typescript + dev: true + + /@typescript-eslint/visitor-keys/5.19.0: + resolution: {integrity: sha512-Ym7zZoMDZcAKWsULi2s7UMLREdVQdScPQ/fKWMYefarCztWlHPFVJo8racf8R0Gc8FAEJ2eD4of8As1oFtnQlQ==} + engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + dependencies: + '@typescript-eslint/types': 5.19.0 + eslint-visitor-keys: 3.3.0 + dev: true + /@typescript-eslint/visitor-keys/5.23.0: resolution: {integrity: sha512-Vd4mFNchU62sJB8pX19ZSPog05B0Y0CE2UxAZPT5k4iqhRYjPnqyY3woMxCd0++t9OTqkgjST+1ydLBi7e2Fvg==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} @@ -2840,6 +2906,27 @@ packages: source-map: 0.6.1 dev: true + /eslint-plugin-jest/26.1.5_kkaclaimgki2r45yqzc3bxhmwy: + resolution: {integrity: sha512-su89aDuljL9bTjEufTXmKUMSFe2kZUL9bi7+woq+C2ukHZordhtfPm4Vg+tdioHBaKf8v3/FXW9uV0ksqhYGFw==} + engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + peerDependencies: + '@typescript-eslint/eslint-plugin': ^5.0.0 + eslint: ^6.0.0 || ^7.0.0 || ^8.0.0 + jest: '*' + peerDependenciesMeta: + '@typescript-eslint/eslint-plugin': + optional: true + jest: + optional: true + dependencies: + '@typescript-eslint/utils': 5.19.0_e4zyhrvfnqudwdx5bevnvkluy4 + eslint: 7.32.0 + jest: 27.4.4 + transitivePeerDependencies: + - supports-color + - typescript + dev: true + /eslint-scope/5.1.1: resolution: {integrity: sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw==} engines: {node: '>=8.0.0'} @@ -2855,6 +2942,16 @@ packages: eslint-visitor-keys: 1.3.0 dev: true + /eslint-utils/3.0.0_eslint@7.32.0: + resolution: {integrity: sha512-uuQC43IGctw68pJA1RgbQS8/NP7rch6Cwd4j3ZBtgo4/8Flj4eGE7ZYSZRN3iq5pVUv6GPdW5Z1RFleo84uLDA==} + engines: {node: ^10.0.0 || ^12.0.0 || >= 14.0.0} + peerDependencies: + eslint: '>=5' + dependencies: + eslint: 7.32.0 + eslint-visitor-keys: 2.1.0 + dev: true + /eslint-visitor-keys/1.3.0: resolution: {integrity: sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ==} engines: {node: '>=4'} @@ -3076,7 +3173,7 @@ packages: engines: {node: '>= 10.17.0'} hasBin: true dependencies: - debug: 4.3.1 + debug: 4.3.3 get-stream: 5.2.0 yauzl: 2.10.0 optionalDependencies: @@ -3531,7 +3628,7 @@ packages: engines: {node: '>= 6'} dependencies: agent-base: 6.0.2 - debug: 4.3.1 + debug: 4.3.3 transitivePeerDependencies: - supports-color dev: true