Browse Source

【集成】提交校验:git 提交 eslint校验 (husky 和 lint-staged)

master
xiaosi 1 year ago
parent
commit
c5e061f167
  1. 4
      .husky/pre-commit
  2. 1078
      package-lock.json
  3. 10
      package.json

4
.husky/pre-commit

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

1078
package-lock.json

File diff suppressed because it is too large

10
package.json

@ -6,7 +6,8 @@
"dev": "vite",
"build": "vite build",
"preview": "vite preview",
"lint": "eslint . --ext .vue,.js,.jsx,.cjs,.mjs --fix --ignore-path .gitignore"
"lint": "eslint . --ext .vue,.js,.jsx,.cjs,.mjs --fix --ignore-path .gitignore",
"prepare": "husky install"
},
"dependencies": {
"pinia": "^2.1.7",
@ -20,7 +21,14 @@
"eslint-config-airbnb-base": "^15.0.0",
"eslint-import-resolver-alias": "^1.1.2",
"eslint-plugin-vue": "^9.17.0",
"husky": "^8.0.0",
"lint-staged": "^15.1.0",
"vite": "^4.4.11",
"vite-plugin-eslint": "^1.8.1"
},
"lint-staged": {
"*.{js,jsx,ts,tsx,vue}": [
"eslint --fix"
]
}
}

Loading…
Cancel
Save