Skip to content

Commit 1172384

Browse files
sudo-suhasyyx990803
authored andcommitted
chore: Setup lint-staged with husky(pre-commit) (#914)
1 parent afdb06b commit 1172384

File tree

2 files changed

+281
-6
lines changed

2 files changed

+281
-6
lines changed

package.json

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,23 @@
2323
},
2424
"homepage": "https://github.com/vuejs/vue-loader",
2525
"scripts": {
26-
"lint": "eslint lib",
26+
"lint": "eslint lib test",
27+
"lint:fix": "eslint lib test --fix",
28+
"precommit": "lint-staged",
2729
"test": "eslint lib && mocha --slow 5000 --timeout 10000",
2830
"docs": "cd docs && gitbook serve",
2931
"docs:deploy": "bash ./docs/deploy.sh"
3032
},
33+
"lint-staged": {
34+
"lib/**/*.js": [
35+
"eslint --fix",
36+
"git add"
37+
],
38+
"test/**/*.js": [
39+
"eslint --fix",
40+
"git add"
41+
]
42+
},
3143
"dependencies": {
3244
"consolidate": "^0.14.0",
3345
"hash-sum": "^1.0.2",
@@ -60,9 +72,11 @@
6072
"expose-loader": "^0.7.1",
6173
"extract-text-webpack-plugin": "^3.0.0",
6274
"file-loader": "^0.11.2",
75+
"husky": "^0.14.3",
6376
"inject-loader": "^3.0.0",
6477
"js-yaml": "^3.9.0",
6578
"jsdom": "^9.2.1",
79+
"lint-staged": "^4.0.2",
6680
"marked": "^0.3.6",
6781
"memory-fs": "^0.4.1",
6882
"mkdirp": "^0.5.1",

0 commit comments

Comments
 (0)