Skip to content

Commit 9e2f9bf

Browse files
author
Chu Fan
committed
feat(eslint): husky代码校验,eslint规则配置
1 parent 3c22c60 commit 9e2f9bf

File tree

3 files changed

+29
-113
lines changed

3 files changed

+29
-113
lines changed

.eslintrc.js

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
module.exports = {
2+
env: {
3+
browser: true,
4+
es2021: true
5+
},
6+
extends: [
7+
'plugin:vue/essential',
8+
'standard'
9+
],
10+
parserOptions: {
11+
ecmaVersion: 12,
12+
parser: '@typescript-eslint/parser',
13+
sourceType: 'module'
14+
},
15+
plugins: [
16+
'vue',
17+
'@typescript-eslint'
18+
],
19+
rules: {
20+
'no-unused-vars': 0
21+
}
22+
}

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
"version": "0.0.1",
77
"description": "一本有趣的JavaScript合集",
88
"scripts": {
9+
"prepare": "husky install && npx husky add .husky/pre-commit \"npm run lintfix\" && chmod +x .husky/pre-commit",
910
"clean": "find . -name \"node_modules\" -type d -exec rm -rf '{}' + && rm -rf docs/.vuepress/dist",
1011
"commit": "git cz",
1112
"dev": "vuepress dev docs",
@@ -29,7 +30,7 @@
2930
"eslint-plugin-n": "^15.0.0",
3031
"eslint-plugin-promise": "^6.0.0",
3132
"eslint-plugin-vue": "^9.9.0",
32-
"husky": "^4.2.3",
33+
"husky": "^8.0.3",
3334
"typescript": "^3.9.10",
3435
"vue": "^3.2.47",
3536
"vuepress": "2.0.0-beta.60",

pnpm-lock.yaml

Lines changed: 5 additions & 112 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)