Skip to content

Commit d106484

Browse files
committedSep 25, 2015
add pre-commit lint hook and install-hook script
1 parent 78d6abe commit d106484

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed
 

‎build/git-hooks/pre-commit

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#!/usr/bin/env bash
2+
3+
# get files to be linted
4+
FILES=$(git diff --cached --name-only | grep -E '^src|^test/unit/specs|^test/e2e')
5+
6+
# lint them if any
7+
if [[ $FILES ]]; then
8+
./node_modules/.bin/eslint $FILES
9+
fi

‎package.json

+1
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
"homepage": "http://vuejs.org",
1919
"scripts": {
2020
"test": "grunt ci",
21+
"install-hook": "ln -s ../../build/git-hooks/pre-commit .git/hooks/pre-commit",
2122
"dev": "webpack --watch --config build/webpack.dev.config.js & webpack --watch --config build/webpack.test.config.js"
2223
},
2324
"dependencies": {

0 commit comments

Comments
 (0)
Please sign in to comment.