Skip to content

Commit 44fa96f

Browse files
authored
chore: add lint-staged (PanJiaChen#818)
1 parent e4481a9 commit 44fa96f

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

package.json

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,14 @@
99
"build:prod": "cross-env NODE_ENV=production env_config=prod node build/build.js",
1010
"build:sit": "cross-env NODE_ENV=production env_config=sit node build/build.js",
1111
"lint": "eslint --ext .js,.vue src",
12-
"test": "npm run lint"
12+
"test": "npm run lint",
13+
"precommit": "lint-staged"
14+
},
15+
"lint-staged": {
16+
"src/**/*.{js,vue}": [
17+
"eslint --fix",
18+
"git add"
19+
]
1320
},
1421
"keywords": [
1522
"vue",
@@ -81,6 +88,8 @@
8188
"file-loader": "1.1.5",
8289
"friendly-errors-webpack-plugin": "1.6.1",
8390
"html-webpack-plugin": "2.30.1",
91+
"husky": "0.14.3",
92+
"lint-staged": "7.2.0",
8493
"node-notifier": "5.1.2",
8594
"node-sass": "^4.7.2",
8695
"optimize-css-assets-webpack-plugin": "3.2.0",

0 commit comments

Comments
 (0)