Skip to content

Commit

Permalink
Set up pre-commit git hook using husky
Browse files Browse the repository at this point in the history
  • Loading branch information
romaricpascal committed Nov 23, 2022
1 parent 9dc3b6a commit 66cbdd4
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 1 deletion.
4 changes: 4 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

npx --no-install lint-staged
16 changes: 16 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@
"lint:js": "npm run lint:js:cli -- \"**/*.{cjs,js,mjs}\"",
"lint:js:cli": "eslint --cache --cache-location .cache/eslint --cache-strategy content --color --ignore-path .gitignore --max-warnings 0",
"lint:scss": "npm run lint:scss:cli -- \"{app,src}/**/*.scss\"",
"lint:scss:cli": "stylelint --cache --cache-location .cache/stylelint --cache-strategy content --color --ignore-path .gitignore --max-warnings 0"
"lint:scss:cli": "stylelint --cache --cache-location .cache/stylelint --cache-strategy content --color --ignore-path .gitignore --max-warnings 0",
"prepare": "node -e \"process.env.CI || require('husky').install() \""
},
"dependencies": {
"@babel/core": "^7.20.2",
Expand Down Expand Up @@ -87,6 +88,7 @@
"eslint-plugin-n": "^15.5.1",
"eslint-plugin-promise": "^6.1.1",
"html-validate": "7.10.0",
"husky": "^8.0.2",
"jest": "^29.3.1",
"jest-axe": "^7.0.0",
"jest-dev-server": "^6.1.1",
Expand Down

0 comments on commit 66cbdd4

Please sign in to comment.