Add husky for pre-commit checks
This commit is contained in:
parent
8804c37d6d
commit
09d5f1c806
8
.husky/pre-commit
Executable file
8
.husky/pre-commit
Executable file
@ -0,0 +1,8 @@
|
||||
#!/usr/bin/env sh
|
||||
. "$(dirname -- "$0")/_/husky.sh"
|
||||
|
||||
npm run format
|
||||
npm run lint
|
||||
|
||||
npm test
|
||||
npm run compile
|
||||
22
package-lock.json
generated
22
package-lock.json
generated
@ -21,6 +21,7 @@
|
||||
"eslint-plugin-n": "^15.7.0",
|
||||
"eslint-plugin-prettier": "^4.2.1",
|
||||
"eslint-plugin-promise": "^6.1.1",
|
||||
"husky": "^8.0.3",
|
||||
"prettier": "2.8.8",
|
||||
"typescript": "^5.0.4"
|
||||
}
|
||||
@ -1688,6 +1689,21 @@
|
||||
"url": "https://github.com/sponsors/ljharb"
|
||||
}
|
||||
},
|
||||
"node_modules/husky": {
|
||||
"version": "8.0.3",
|
||||
"resolved": "https://registry.npmjs.org/husky/-/husky-8.0.3.tgz",
|
||||
"integrity": "sha512-+dQSyqPh4x1hlO1swXBiNb2HzTDN1I2IGLQx1GrBuiqFJfoMrnZWwVmatvSiO+Iz8fBUnf+lekwNo4c2LlXItg==",
|
||||
"dev": true,
|
||||
"bin": {
|
||||
"husky": "lib/bin.js"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=14"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/typicode"
|
||||
}
|
||||
},
|
||||
"node_modules/ignore": {
|
||||
"version": "5.2.4",
|
||||
"resolved": "https://registry.npmjs.org/ignore/-/ignore-5.2.4.tgz",
|
||||
@ -4064,6 +4080,12 @@
|
||||
"has-symbols": "^1.0.2"
|
||||
}
|
||||
},
|
||||
"husky": {
|
||||
"version": "8.0.3",
|
||||
"resolved": "https://registry.npmjs.org/husky/-/husky-8.0.3.tgz",
|
||||
"integrity": "sha512-+dQSyqPh4x1hlO1swXBiNb2HzTDN1I2IGLQx1GrBuiqFJfoMrnZWwVmatvSiO+Iz8fBUnf+lekwNo4c2LlXItg==",
|
||||
"dev": true
|
||||
},
|
||||
"ignore": {
|
||||
"version": "5.2.4",
|
||||
"resolved": "https://registry.npmjs.org/ignore/-/ignore-5.2.4.tgz",
|
||||
|
||||
11
package.json
11
package.json
@ -9,14 +9,16 @@
|
||||
"url": "https://git.verdigado.com/NB-Public/rocketchat2matrix"
|
||||
},
|
||||
"scripts": {
|
||||
"format": "prettier 'src/**/*.ts' --write",
|
||||
"format": "prettier 'src/**/*.ts' --check",
|
||||
"format-fix": "prettier 'src/**/*.ts' --write",
|
||||
"lint": "eslint src/ --ext .ts",
|
||||
"lint-fix": "eslint src/ --fix --ext .ts",
|
||||
"prefix": "npm run format",
|
||||
"prefix": "npm run format-fix",
|
||||
"fix": "npm run lint-fix",
|
||||
"test": "echo \"Error: no test specified\" && exit 1",
|
||||
"test": "echo \"Warning: no test specified\"",
|
||||
"compile": "rm -rf dist/ && tsc",
|
||||
"start": "npm run compile && node dist/app.js"
|
||||
"start": "npm run compile && node dist/app.js",
|
||||
"prepare": "husky install"
|
||||
},
|
||||
"version": "0.1.0",
|
||||
"devDependencies": {
|
||||
@ -29,6 +31,7 @@
|
||||
"eslint-plugin-n": "^15.7.0",
|
||||
"eslint-plugin-prettier": "^4.2.1",
|
||||
"eslint-plugin-promise": "^6.1.1",
|
||||
"husky": "^8.0.3",
|
||||
"prettier": "2.8.8",
|
||||
"typescript": "^5.0.4"
|
||||
},
|
||||
|
||||
Loading…
Reference in New Issue
Block a user