chore: add husky and lint-staged

This commit is contained in:
Nex Zhu 2021-12-27 16:14:28 +08:00
parent 4908523bc4
commit 32d835ff27
No known key found for this signature in database
GPG Key ID: 15C6254AD19362B4
5 changed files with 990 additions and 1 deletions

1
.husky/.gitignore vendored Normal file
View File

@ -0,0 +1 @@
_

4
.husky/pre-commit Normal file
View File

@ -0,0 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"
npx lint-staged

4
.lintstagedrc.json Normal file
View File

@ -0,0 +1,4 @@
{
"src/**/*.{js,ts,tsx,vue}": "eslint --cache --fix",
"src/**/*.{css,scss,vue,tsx}": "stylelint --fix"
}

974
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -13,7 +13,8 @@
"eslint": "eslint src/**/*.{js,ts,tsx,vue}",
"eslint:fix": "eslint src/**/*.{js,ts,tsx,vue} --fix",
"stylelint": "stylelint src/**/*.{css,scss,vue,tsx}",
"stylelint:fix": "stylelint src/**/*.{css,scss,vue,tsx} --fix"
"stylelint:fix": "stylelint src/**/*.{css,scss,vue,tsx} --fix",
"prepare": "husky install"
},
"prettier": "@daotl/prettier-config",
"keywords": [
@ -43,6 +44,8 @@
"@fesjs/plugin-sass": "^2.0.0",
"@vue/compiler-sfc": "^3.2.26",
"cross-env": "^7.0.3",
"husky": "^7.0.4",
"lint-staged": "^12.1.4",
"postcss-html": "^1.3.0",
"stylelint": "^14.2.0",
"stylelint-config-property-sort-order-smacss": "^8.0.0",
@ -58,5 +61,8 @@
"@fesjs/plugin-model": "^2.0.3",
"ant-design-vue": "^2.2.0",
"vue": "^3.2.6"
},
"lint-staged": {
"*.css": "stylelint --fix"
}
}