Skip to content
Merged
Show file tree
Hide file tree
Changes from 7 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
/lib
/node_modules
/themes
/.husky/_

# exceptions
!.gitkeep
5 changes: 5 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

npm run prettier
npx lint-staged
4 changes: 4 additions & 0 deletions build/husky.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
echo "Husky installing ..."
npm install husky --save-dev
npx husky install
echo "Husky is already installed and hooks enabled."
7 changes: 1 addition & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
"prettier": "prettier . --write",
"lint:fix": "eslint . --fix",
"lint": "prettier . --check && eslint .",
"postinstall": "opencollective-postinstall",
"postinstall": "opencollective-postinstall && sh build/husky.sh",
"prepare": "npm run build",
"pub:next": "cross-env RELEASE_TAG=next sh build/release.sh",
"pub": "sh build/release.sh",
Expand All @@ -57,11 +57,6 @@
"watch:css": "npm run css -- -o themes -w",
"watch:js": "node build/build.js"
},
"husky": {
"hooks": {
"pre-commit": "lint-staged"
}
},
"lint-staged": {
"*.js": "eslint --fix"
},
Expand Down