add husky

This commit is contained in:
hazycora 2024-07-30 13:13:54 -05:00
parent 534019bb88
commit 24f5dcea91
No known key found for this signature in database
GPG Key ID: 215AF1F81F86940E
3 changed files with 15 additions and 1 deletions

2
.husky/pre-commit Normal file
View File

@ -0,0 +1,2 @@
prettier $(git diff --cached --name-only --diff-filter=ACMR | sed 's| |\\ |g') --write --ignore-unknown
git update-index --again

View File

@ -8,7 +8,8 @@
"scripts": { "scripts": {
"tsc": "tsc", "tsc": "tsc",
"lint": "prettier --check . && eslint .", "lint": "prettier --check . && eslint .",
"format": "prettier --write ." "format": "prettier --write .",
"prepare": "husky"
}, },
"exports": { "exports": {
".": "./build/index.js", ".": "./build/index.js",
@ -41,6 +42,7 @@
"@typescript-eslint/parser": "^6.21.0", "@typescript-eslint/parser": "^6.21.0",
"eslint": "^8.56.0", "eslint": "^8.56.0",
"eslint-config-prettier": "^9.1.0", "eslint-config-prettier": "^9.1.0",
"husky": "^9.1.4",
"prettier": "^3.2.5", "prettier": "^3.2.5",
"typescript": "^5.3.3" "typescript": "^5.3.3"
} }

10
pnpm-lock.yaml generated
View File

@ -39,6 +39,9 @@ importers:
eslint-config-prettier: eslint-config-prettier:
specifier: ^9.1.0 specifier: ^9.1.0
version: 9.1.0(eslint@8.56.0) version: 9.1.0(eslint@8.56.0)
husky:
specifier: ^9.1.4
version: 9.1.4
prettier: prettier:
specifier: ^3.2.5 specifier: ^3.2.5
version: 3.2.5 version: 3.2.5
@ -406,6 +409,11 @@ packages:
resolution: {integrity: sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==} resolution: {integrity: sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==}
engines: {node: '>=8'} engines: {node: '>=8'}
husky@9.1.4:
resolution: {integrity: sha512-bho94YyReb4JV7LYWRWxZ/xr6TtOTt8cMfmQ39MQYJ7f/YE268s3GdghGwi+y4zAeqewE5zYLvuhV0M0ijsDEA==}
engines: {node: '>=18'}
hasBin: true
ignore@5.3.1: ignore@5.3.1:
resolution: {integrity: sha512-5Fytz/IraMjqpwfd34ke28PTVMjZjJG2MPn5t7OE4eUCUNf8BAa7b5WUS9/Qvr6mwOQS7Mk6vdsMno5he+T8Xw==} resolution: {integrity: sha512-5Fytz/IraMjqpwfd34ke28PTVMjZjJG2MPn5t7OE4eUCUNf8BAa7b5WUS9/Qvr6mwOQS7Mk6vdsMno5he+T8Xw==}
engines: {node: '>= 4'} engines: {node: '>= 4'}
@ -1105,6 +1113,8 @@ snapshots:
has-flag@4.0.0: {} has-flag@4.0.0: {}
husky@9.1.4: {}
ignore@5.3.1: {} ignore@5.3.1: {}
image-size@1.1.1: image-size@1.1.1: