Skip to content

Commit

Permalink
Add pre-commit linter hook
Browse files Browse the repository at this point in the history
  • Loading branch information
renintw committed Mar 27, 2023
1 parent ea4f1ad commit 179e959
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
5 changes: 5 additions & 0 deletions settings/.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"

cd settings
npx lint-staged
15 changes: 13 additions & 2 deletions settings/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@
"packages-update": "wp-scripts packages-update",
"start": "wp-scripts start --webpack-copy-php",
"test:unit": "wp-scripts test-unit-js",
"test:unit:watch": "wp-scripts test-unit-js --watch"
"test:unit:watch": "wp-scripts test-unit-js --watch",
"prepare": "cd .. && husky install settings/.husky"
},
"dependencies": {
"@automattic/generate-password": "^0.1.0"
Expand All @@ -27,6 +28,16 @@
"@wordpress/data": "^8.4.0",
"@wordpress/element": "^5.4.0",
"@wordpress/icons": "^9.18.0",
"@wordpress/scripts": "^24.6.0"
"@wordpress/scripts": "^24.6.0",
"lint-staged": "^13.2.0",
"husky": "^8.0.0"
},
"lint-staged": {
"*.js": [
"npm run lint:js"
],
"*.{css,scss}": [
"npm run lint:css"
]
}
}

0 comments on commit 179e959

Please sign in to comment.