Added precommit hook and staged checking of linting and formatting

This commit is contained in:
Nathan Byrd 2023-01-13 09:14:00 -06:00
parent 33ea963a14
commit 4137e935d2
5 changed files with 3087 additions and 2156 deletions

4
.husky/pre-commit Executable file
View File

@ -0,0 +1,4 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"
npx lint-staged

6
.lintstagedrc.json Normal file
View File

@ -0,0 +1,6 @@
{
"*.js": [
"npx eslint --fix",
"npx prettier --write"
]
}

1285
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -11,7 +11,8 @@
"scripts": {
"start": "node main.js",
"oputil": "node ./oputil.js",
"pretty": "npx prettier --write ."
"pretty": "npx prettier --write .",
"prepare": "husky install"
},
"repository": {
"type": "git",
@ -72,6 +73,8 @@
"devDependencies": {
"eslint": "8.31.0",
"eslint-config-prettier": "^8.5.0",
"husky": "^8.0.0",
"lint-staged": "^13.1.0",
"prettier": "2.8.1"
},
"engines": {

3941
yarn.lock

File diff suppressed because it is too large Load Diff