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 85e9250 commit f8a5ad9
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 @@ -32,7 +32,8 @@
"test:screenshots": "node ./tasks/screenshot-components.mjs",
"lint": "npm run lint:js && npm run lint:scss",
"lint:js": "eslint --cache --cache-location .cache/eslint --cache-strategy content --color --ignore-path .gitignore --max-warnings 0 \"**/*.{cjs,js,mjs}\"",
"lint:scss": "stylelint --cache --cache-location .cache/stylelint --cache-strategy content --color --ignore-path .gitignore --max-warnings 0 \"{app,src}/**/*.scss\""
"lint:scss": "stylelint --cache --cache-location .cache/stylelint --cache-strategy content --color --ignore-path .gitignore --max-warnings 0 \"{app,src}/**/*.scss\"",
"prepare": "husky install"
},
"dependencies": {
"@babel/core": "^7.20.2",
Expand Down Expand Up @@ -85,6 +86,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 f8a5ad9

Please sign in to comment.