From a4fb76266fcc261ca1bfd3c3c8d0c9a12f29bbcc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=89=E5=92=B2=E6=99=BA=E5=AD=90?= Date: Mon, 12 Sep 2022 22:09:08 +0800 Subject: [PATCH] chore: add linter and formatter cache (#9738) --- .gitignore | 1 + .husky/pre-commit | 1 - package.json | 7 +++-- pnpm-lock.yaml | 67 ----------------------------------------------- 4 files changed, 4 insertions(+), 72 deletions(-) diff --git a/.gitignore b/.gitignore index 2a86f07048..c720febdf0 100644 --- a/.gitignore +++ b/.gitignore @@ -15,6 +15,7 @@ packages/element-plus/version.ts # local env files *.local +.eslintcache cypress/screenshots/* cypress/videos/* tmp diff --git a/.husky/pre-commit b/.husky/pre-commit index 5b22231f76..5e59273569 100755 --- a/.husky/pre-commit +++ b/.husky/pre-commit @@ -2,4 +2,3 @@ . "$(dirname "$0")/_/husky.sh" pnpm exec lint-staged -pnpm exec pretty-quick --staged diff --git a/package.json b/package.json index 7edadf42bf..fef708a4c4 100644 --- a/package.json +++ b/package.json @@ -21,9 +21,9 @@ "clean:dist": "rimraf dist", "build": "pnpm run -C internal/build start", "build:theme": "pnpm run -C packages/theme-chalk build", - "format": "prettier --write .", - "lint": "eslint . --ext .vue,.js,.ts,.jsx,.tsx,.md,.json --max-warnings 0 && pretty-quick --check --branch dev", - "lint:fix": "eslint --fix . --ext .vue,.js,.ts,.jsx,.tsx,.md,.json && pretty-quick --branch dev", + "format": "prettier --write --cache .", + "lint": "eslint . --ext .vue,.js,.ts,.jsx,.tsx,.md,.json --max-warnings 0 --cache", + "lint:fix": "pnpm run lint --fix", "lint:commit": "commitlint --from $(git merge-base origin/dev HEAD) --to HEAD > ./commit-lint.txt", "typecheck": "run-p typecheck:web typecheck:play typecheck:node typecheck:vite-config typecheck:vitest", "typecheck:web": "vue-tsc -p tsconfig.web.json --composite false --noEmit", @@ -104,7 +104,6 @@ "lint-staged": "^13.0.3", "npm-run-all": "^4.1.5", "prettier": "^2.7.1", - "pretty-quick": "^3.1.3", "puppeteer": "^17.1.3", "resize-observer-polyfill": "^1.5.1", "rimraf": "^3.0.2", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 325257db07..6ecbc3f3f4 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -62,7 +62,6 @@ importers: normalize-wheel-es: ^1.2.0 npm-run-all: ^4.1.5 prettier: ^2.7.1 - pretty-quick: ^3.1.3 puppeteer: ^17.1.3 resize-observer-polyfill: ^1.5.1 rimraf: ^3.0.2 @@ -137,7 +136,6 @@ importers: lint-staged: 13.0.3 npm-run-all: 4.1.5 prettier: 2.7.1 - pretty-quick: 3.1.3_prettier@2.7.1 puppeteer: 17.1.3 resize-observer-polyfill: 1.5.1 rimraf: 3.0.2 @@ -3901,11 +3899,6 @@ packages: resolution: {integrity: sha512-sKpyeERZ02v1FeCZT8lrfJq5u6goHCtpTAzPwJYe7c8SPFOboNjNg1vz2L4VTn9T4PQxEx13TbXLmYUcS6Ug7Q==} engines: {node: '>=0.10.0'} - /array-differ/3.0.0: - resolution: {integrity: sha512-THtfYS6KtME/yIAhKjZ2ul7XI96lQGHRputJQHO80LAWQnuGP4iCIN8vdMRboGbIEYBwU33q8Tch1os2+X0kMg==} - engines: {node: '>=8'} - dev: true - /array-each/1.0.1: resolution: {integrity: sha512-zHjL5SZa68hkKHBFBK6DJCTtr9sfTCPCaph/L7tMSLcTFgy+zX7E+6q5UArbtOtMBCtxdICpfTCspRse+ywyXA==} engines: {node: '>=0.10.0'} @@ -3979,11 +3972,6 @@ packages: engines: {node: '>=0.10.0'} dev: true - /arrify/2.0.1: - resolution: {integrity: sha512-3duEwti880xqi4eAMN8AyR4a0ByT90zoYdLlevfrvU43vb0YZwZVfxOgxWrLXXXpyugL0hNZc9G6BiB5B3nUug==} - engines: {node: '>=8'} - dev: true - /as-table/1.0.55: resolution: {integrity: sha512-xvsWESUJn0JN421Xb9MQw6AsMHRCUknCe0Wjlxvjud80mU4E6hQf1A6NzQKcYNmYw62MfzEtXc+badstZP3JpQ==} dependencies: @@ -4465,14 +4453,6 @@ packages: escape-string-regexp: 1.0.5 supports-color: 5.5.0 - /chalk/3.0.0: - resolution: {integrity: sha512-4D3B6Wf41KOYRFdszmDqMCGq5VV/uMAB273JILmO+3jAlh8X4qDtdtgCR3fxtbLEMzSx22QdhnDcJvu2u1fVwg==} - engines: {node: '>=8'} - dependencies: - ansi-styles: 4.3.0 - supports-color: 7.2.0 - dev: true - /chalk/4.1.2: resolution: {integrity: sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==} engines: {node: '>=10'} @@ -6240,21 +6220,6 @@ packages: dev: true optional: true - /execa/4.1.0: - resolution: {integrity: sha512-j5W0//W7f8UxAn8hXVnwG8tLwdiUy4FJLcSupCg6maBYZDpyBvTApK7KyuI4bKj8KOh1r2YH+6ucuYtJv1bTZA==} - engines: {node: '>=10'} - dependencies: - cross-spawn: 7.0.3 - get-stream: 5.2.0 - human-signals: 1.1.1 - is-stream: 2.0.1 - merge-stream: 2.0.0 - npm-run-path: 4.0.1 - onetime: 5.1.2 - signal-exit: 3.0.7 - strip-final-newline: 2.0.0 - dev: true - /execa/5.1.1: resolution: {integrity: sha512-8uSpZZocAZRBAPIEINJj3Lo9HyGitllczc27Eh5YYojjMFMn8yHMDMaUHE2Jqfq05D/wucwI4JGURyXt1vchyg==} engines: {node: '>=10'} @@ -7129,11 +7094,6 @@ packages: - supports-color dev: true - /human-signals/1.1.1: - resolution: {integrity: sha512-SEQu7vl8KjNL2eoGBLF3+wAjpsNfA9XMlXAYj/3EdaNfAlxKthD1xjEQfGOUhllCGGJVNY34bRr6lPINhNjyZw==} - engines: {node: '>=8.12.0'} - dev: true - /human-signals/2.1.0: resolution: {integrity: sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw==} engines: {node: '>=10.17.0'} @@ -8428,17 +8388,6 @@ packages: /ms/2.1.3: resolution: {integrity: sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==} - /multimatch/4.0.0: - resolution: {integrity: sha512-lDmx79y1z6i7RNx0ZGCPq1bzJ6ZoDDKbvh7jxr9SJcWLkShMzXrHbYVpTdnhNM5MXpDUxCQ4DgqVttVXlBgiBQ==} - engines: {node: '>=8'} - dependencies: - '@types/minimatch': 3.0.5 - array-differ: 3.0.0 - array-union: 2.1.0 - arrify: 2.0.1 - minimatch: 3.1.2 - dev: true - /mute-stdout/1.0.1: resolution: {integrity: sha512-kDcwXR4PS7caBpuRYYBUz9iVixUk3anO3f5OYFiIPwK/20vCzKCHyKoulbiDY1S53zD2bxUpxN/IJ+TnXjfvxg==} engines: {node: '>= 0.10'} @@ -9172,22 +9121,6 @@ packages: dependencies: parse-ms: 2.1.0 - /pretty-quick/3.1.3_prettier@2.7.1: - resolution: {integrity: sha512-kOCi2FJabvuh1as9enxYmrnBC6tVMoVOenMaBqRfsvBHB0cbpYHjdQEpSglpASDFEXVwplpcGR4CLEaisYAFcA==} - engines: {node: '>=10.13'} - hasBin: true - peerDependencies: - prettier: '>=2.0.0' - dependencies: - chalk: 3.0.0 - execa: 4.1.0 - find-up: 4.1.0 - ignore: 5.2.0 - mri: 1.2.0 - multimatch: 4.0.0 - prettier: 2.7.1 - dev: true - /printable-characters/1.0.42: resolution: {integrity: sha512-dKp+C4iXWK4vVYZmYSd0KBH5F/h1HoZRsbJ82AVKRO3PEo8L4lBS/vLwhVtpwwuYcoIsVY+1JYKR268yn480uQ==}