Lint code on commit with Husky npm

This commit is contained in:
Alex Gleason 2021-09-15 10:47:10 -05:00
parent 55ca03faaf
commit dbc20362fd
No known key found for this signature in database
GPG key ID: 7211D1F99744FBB7
4 changed files with 13 additions and 1 deletions

1
.husky/.gitignore vendored Normal file
View file

@ -0,0 +1 @@
_

4
.husky/pre-commit Executable file
View file

@ -0,0 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"
yarn test:lint

View file

@ -25,7 +25,8 @@
"test:lint": "${npm_execpath} run test:lint:js && ${npm_execpath} run test:lint:sass",
"test:lint:js": "npx eslint --ext=js . --cache",
"test:lint:sass": "npx stylelint app/styles/**.scss app/styles/**/*.scss",
"test:jest": "npx jest --coverage"
"test:jest": "npx jest --coverage",
"prepare": "husky install"
},
"license": "AGPL-3.0-or-later",
"browserslist": [
@ -170,6 +171,7 @@
"eslint-plugin-promise": "^5.1.0",
"eslint-plugin-react": "^7.25.1",
"eslint-plugin-react-hooks": "^4.2.0",
"husky": "^7.0.2",
"jest": "^27.1.0",
"raf": "^3.4.1",
"react-intl-translations-manager": "^5.0.3",

View file

@ -6177,6 +6177,11 @@ human-signals@^2.1.0:
resolved "https://registry.yarnpkg.com/human-signals/-/human-signals-2.1.0.tgz#dc91fcba42e4d06e4abaed33b3e7a3c02f514ea0"
integrity sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw==
husky@^7.0.2:
version "7.0.2"
resolved "https://registry.yarnpkg.com/husky/-/husky-7.0.2.tgz#21900da0f30199acca43a46c043c4ad84ae88dff"
integrity sha512-8yKEWNX4z2YsofXAMT7KvA1g8p+GxtB1ffV8XtpAEGuXNAbCV5wdNKH+qTpw8SM9fh4aMPDR+yQuKfgnreyZlg==
iconv-lite@0.4.24, iconv-lite@^0.4.4, iconv-lite@~0.4.13:
version "0.4.24"
resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.24.tgz#2022b4b25fbddc21d2f524974a474aafe733908b"