Added precommit hook and staged checking of linting and formatting
This commit is contained in:
parent
33ea963a14
commit
4137e935d2
|
@ -0,0 +1,4 @@
|
||||||
|
#!/usr/bin/env sh
|
||||||
|
. "$(dirname -- "$0")/_/husky.sh"
|
||||||
|
|
||||||
|
npx lint-staged
|
|
@ -0,0 +1,6 @@
|
||||||
|
{
|
||||||
|
"*.js": [
|
||||||
|
"npx eslint --fix",
|
||||||
|
"npx prettier --write"
|
||||||
|
]
|
||||||
|
}
|
File diff suppressed because it is too large
Load Diff
|
@ -11,7 +11,8 @@
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"start": "node main.js",
|
"start": "node main.js",
|
||||||
"oputil": "node ./oputil.js",
|
"oputil": "node ./oputil.js",
|
||||||
"pretty": "npx prettier --write ."
|
"pretty": "npx prettier --write .",
|
||||||
|
"prepare": "husky install"
|
||||||
},
|
},
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
|
@ -72,6 +73,8 @@
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"eslint": "8.31.0",
|
"eslint": "8.31.0",
|
||||||
"eslint-config-prettier": "^8.5.0",
|
"eslint-config-prettier": "^8.5.0",
|
||||||
|
"husky": "^8.0.0",
|
||||||
|
"lint-staged": "^13.1.0",
|
||||||
"prettier": "2.8.1"
|
"prettier": "2.8.1"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
|
|
Loading…
Reference in New Issue