add git hook

cjs
Hunter 3 years ago
parent 4c07b78b6c
commit d5dbd0e484

@ -0,0 +1 @@
try to run `chmod +x ./.husky/pre-commit` if pre-commit doesn't work.

@ -0,0 +1 @@
npx eslint ./src --ext .js,.vue

19
package-lock.json generated

@ -20,6 +20,7 @@
"eslint": "^8.14.0", "eslint": "^8.14.0",
"eslint-config-airbnb-base": "^15.0.0", "eslint-config-airbnb-base": "^15.0.0",
"eslint-plugin-vue": "^8.7.1", "eslint-plugin-vue": "^8.7.1",
"husky": "^7.0.4",
"less": "^4.1.2", "less": "^4.1.2",
"less-loader": "^10.2.0", "less-loader": "^10.2.0",
"mockjs": "^1.1.0", "mockjs": "^1.1.0",
@ -2390,6 +2391,18 @@
"node": ">= 12" "node": ">= 12"
} }
}, },
"node_modules/husky": {
"version": "7.0.4",
"resolved": "https://registry.npmmirror.com/husky/-/husky-7.0.4.tgz",
"integrity": "sha512-vbaCKN2QLtP/vD4yvs6iz6hBEo6wkSzs8HpRah1Z6aGmF2KW5PdYuAd7uX5a+OyBZHBhd+TFLqgjUgytQr4RvQ==",
"dev": true,
"bin": {
"husky": "lib/bin.js"
},
"engines": {
"node": ">=12"
}
},
"node_modules/iconv-lite": { "node_modules/iconv-lite": {
"version": "0.4.24", "version": "0.4.24",
"resolved": "https://registry.npmmirror.com/iconv-lite/-/iconv-lite-0.4.24.tgz", "resolved": "https://registry.npmmirror.com/iconv-lite/-/iconv-lite-0.4.24.tgz",
@ -6037,6 +6050,12 @@
} }
} }
}, },
"husky": {
"version": "7.0.4",
"resolved": "https://registry.npmmirror.com/husky/-/husky-7.0.4.tgz",
"integrity": "sha512-vbaCKN2QLtP/vD4yvs6iz6hBEo6wkSzs8HpRah1Z6aGmF2KW5PdYuAd7uX5a+OyBZHBhd+TFLqgjUgytQr4RvQ==",
"dev": true
},
"iconv-lite": { "iconv-lite": {
"version": "0.4.24", "version": "0.4.24",
"resolved": "https://registry.npmmirror.com/iconv-lite/-/iconv-lite-0.4.24.tgz", "resolved": "https://registry.npmmirror.com/iconv-lite/-/iconv-lite-0.4.24.tgz",

@ -10,7 +10,8 @@
"preview": "npm run build && vite preview", "preview": "npm run build && vite preview",
"preview:staging": "npm run build:staging && vite preview --mode=staging", "preview:staging": "npm run build:staging && vite preview --mode=staging",
"lint": "eslint ./src --ext .js,.vue", "lint": "eslint ./src --ext .js,.vue",
"lint:fix": "eslint ./src --ext .js,.vue --fix" "lint:fix": "eslint ./src --ext .js,.vue --fix",
"prepare": "husky install"
}, },
"dependencies": { "dependencies": {
"axios": "^0.27.0", "axios": "^0.27.0",
@ -25,6 +26,7 @@
"eslint": "^8.14.0", "eslint": "^8.14.0",
"eslint-config-airbnb-base": "^15.0.0", "eslint-config-airbnb-base": "^15.0.0",
"eslint-plugin-vue": "^8.7.1", "eslint-plugin-vue": "^8.7.1",
"husky": "^7.0.4",
"less": "^4.1.2", "less": "^4.1.2",
"less-loader": "^10.2.0", "less-loader": "^10.2.0",
"mockjs": "^1.1.0", "mockjs": "^1.1.0",

Loading…
Cancel
Save