Configure husky to run prettier via lint-staged

This commit is contained in:
bjoluc 2021-08-13 22:04:28 +02:00
parent 017b45d87e
commit 105b041255
4 changed files with 837 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"
npx lint-staged

826
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -8,7 +8,7 @@
"test": "jest",
"build": "npm run build -ws",
"build:archive": "gulp createDistArchive",
"prepare": "npm run build",
"prepare": "husky install && npm run build",
"tsc": "npm run tsc -ws"
},
"devDependencies": {
@ -26,9 +26,11 @@
"gulp-rename": "^2.0.0",
"gulp-replace": "^1.1.3",
"gulp-zip": "^5.1.0",
"husky": "^7.0.1",
"import-sort-style-module": "^6.0.0",
"jest": "^27.0.6",
"jest-environment-jsdom": "^27.0.6",
"lint-staged": "^11.1.2",
"merge-stream": "^2.0.0",
"prettier": "^2.3.2",
"prettier-plugin-import-sort": "^0.0.7",
@ -47,5 +49,8 @@
"style": "module",
"parser": "typescript"
}
},
"lint-staged": {
"*.{ts,js,mjs,cjs}": "prettier --write"
}
}