Add pre-commit hook to auto-run/fix prettier and eslint

This commit is contained in:
Matt Rubens
2025-01-17 14:04:37 -05:00
parent 4a6fdf2b18
commit 3bcb4ff8c5
2 changed files with 314 additions and 278 deletions

41
package-lock.json generated
View File

@@ -73,6 +73,7 @@
"jest-simple-dot-reporter": "^1.0.5",
"lint-staged": "^15.2.11",
"npm-run-all": "^4.1.5",
"prettier": "^3.4.2",
"ts-jest": "^29.2.5",
"typescript": "^5.4.5"
},
@@ -2733,6 +2734,21 @@
"semver": "^7.5.3"
}
},
"node_modules/@changesets/apply-release-plan/node_modules/prettier": {
"version": "2.8.8",
"resolved": "https://registry.npmjs.org/prettier/-/prettier-2.8.8.tgz",
"integrity": "sha512-tdN8qQGvNjw4CHbY+XXk0JgCXn9QiF21a55rBe5LJAU+kDyC4WQn4+awm2Xfk2lQMk5fKup9XgzTZtGkjBdP9Q==",
"dev": true,
"bin": {
"prettier": "bin-prettier.js"
},
"engines": {
"node": ">=10.13.0"
},
"funding": {
"url": "https://github.com/prettier/prettier?sponsor=1"
}
},
"node_modules/@changesets/apply-release-plan/node_modules/resolve-from": {
"version": "5.0.0",
"resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz",
@@ -2999,6 +3015,21 @@
"prettier": "^2.7.1"
}
},
"node_modules/@changesets/write/node_modules/prettier": {
"version": "2.8.8",
"resolved": "https://registry.npmjs.org/prettier/-/prettier-2.8.8.tgz",
"integrity": "sha512-tdN8qQGvNjw4CHbY+XXk0JgCXn9QiF21a55rBe5LJAU+kDyC4WQn4+awm2Xfk2lQMk5fKup9XgzTZtGkjBdP9Q==",
"dev": true,
"bin": {
"prettier": "bin-prettier.js"
},
"engines": {
"node": ">=10.13.0"
},
"funding": {
"url": "https://github.com/prettier/prettier?sponsor=1"
}
},
"node_modules/@esbuild/aix-ppc64": {
"version": "0.24.0",
"resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.24.0.tgz",
@@ -13217,15 +13248,15 @@
}
},
"node_modules/prettier": {
"version": "2.8.8",
"resolved": "https://registry.npmjs.org/prettier/-/prettier-2.8.8.tgz",
"integrity": "sha512-tdN8qQGvNjw4CHbY+XXk0JgCXn9QiF21a55rBe5LJAU+kDyC4WQn4+awm2Xfk2lQMk5fKup9XgzTZtGkjBdP9Q==",
"version": "3.4.2",
"resolved": "https://registry.npmjs.org/prettier/-/prettier-3.4.2.tgz",
"integrity": "sha512-e9MewbtFo+Fevyuxn/4rrcDAaq0IYxPGLvObpQjiZBMAzB9IGmzlnG9RZy3FFas+eBMu2vA0CszMeduow5dIuQ==",
"dev": true,
"bin": {
"prettier": "bin-prettier.js"
"prettier": "bin/prettier.cjs"
},
"engines": {
"node": ">=10.13.0"
"node": ">=14"
},
"funding": {
"url": "https://github.com/prettier/prettier?sponsor=1"

View File

@@ -219,6 +219,7 @@
"jest-simple-dot-reporter": "^1.0.5",
"lint-staged": "^15.2.11",
"npm-run-all": "^4.1.5",
"prettier": "^3.4.2",
"ts-jest": "^29.2.5",
"typescript": "^5.4.5"
},
@@ -268,8 +269,12 @@
"zod": "^3.23.8"
},
"lint-staged": {
"*.{js,jsx,ts,tsx,json,css,md}": [
"prettier --write"
],
"src/**/*.{ts,tsx}": [
"npx eslint -c .eslintrc.json"
"prettier --write",
"npx eslint -c .eslintrc.json --fix"
]
}
}