feat-配置 husky + lint-staged

This commit is contained in:
h_mo 2022-06-03 12:36:25 +08:00
parent b7ae8b7349
commit 56d7962595
3 changed files with 3065 additions and 3018 deletions

1
.gitignore vendored
View File

@ -3,3 +3,4 @@
/.idea/
/.hbuilderx/
/.eslintcache
/.husky/

View File

@ -31,7 +31,8 @@
"build:quickapp-webview-huawei": "uni build -p quickapp-webview-huawei",
"build:quickapp-webview-union": "uni build -p quickapp-webview-union",
"lint": "eslint --cache --max-warnings 0 \"src/**/*.{vue,ts}\" --fix",
"prettier": "prettier --write \"src/**/*.{js,ts,json,css,scss,vue}\""
"prettier": "prettier --write \"src/**/*.{js,ts,json,css,scss,vue}\"",
"prepare": "husky install"
},
"dependencies": {
"@dcloudio/uni-app": "3.0.0-alpha-3040820220424001",
@ -62,11 +63,26 @@
"eslint-config-prettier": "^8.5.0",
"eslint-plugin-prettier": "^4.0.0",
"eslint-plugin-vue": "^9.1.0",
"husky": "^8.0.1",
"lint-staged": "^13.0.0",
"mrm": "^4.0.0",
"prettier": "^2.6.2",
"sass": "^1.52.1",
"typescript": "^4.6.3",
"vite": "^2.9.6",
"vite-plugin-eslint": "^1.6.1",
"vite-plugin-windicss": "^1.8.4"
},
"husky": {
"hooks": {
"pre-commit": "lint-staged"
}
},
"lint-staged": {
"*.{js,jsx,vue,ts,tsx}": [
"pnpm lint",
"prettier --write",
"git add"
]
}
}

6064
pnpm-lock.yaml generated

File diff suppressed because it is too large Load Diff