Skip to content

Commit 28e231c

Browse files
authored
Merge pull request #184 from jamesgeorge007/feat/configure-pre-commit-hook
feat(chore): configure pre-commit hook
2 parents 626c8bc + 1e0d1d2 commit 28e231c

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

package.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,9 @@
2929
"eslint-config-prettier": "^6.3.0",
3030
"eslint-plugin-import": "^2.14.0",
3131
"eslint-plugin-prettier": "^3.1.0",
32+
"husky": "^3.0.9",
3233
"jest": "^24.0.0",
34+
"lint-staged": "^9.4.2",
3335
"prettier": "^1.14.3",
3436
"tmp": "^0.1.0"
3537
},
@@ -56,6 +58,14 @@
5658
"test-gen-swagger": "rm -rf ./tmp && yarn build && ./lib/index.js https://demo.api-platform.com/docs.json ./tmp/react -f swagger && ./lib/index.js https://demo.api-platform.com/docs.json ./tmp/react-native -g react-native -f swagger && ./lib/index.js https://demo.api-platform.com/docs.json ./tmp/vue -g vue -f swagger && ./lib/index.js https://demo.api-platform.com/docs.json ./tmp/admin-on-rest -g admin-on-rest -f swagger",
5759
"test-gen-env": "rm -rf ./tmp && yarn build && API_PLATFORM_CLIENT_GENERATOR_ENTRYPOINT=https://demo.api-platform.com API_PLATFORM_CLIENT_GENERATOR_OUTPUT=./tmp ./lib/index.js"
5860
},
61+
"husky": {
62+
"hooks": {
63+
"pre-commit": "lint-staged"
64+
}
65+
},
66+
"lint-staged": {
67+
"src/**/*.js": "npm run lint"
68+
},
5969
"bin": {
6070
"generate-api-platform-client": "./lib/index.js"
6171
},

0 commit comments

Comments
 (0)