Add lint-staged

This prevents unstaged files and unstaged changes to staged files from being checked.
This commit is contained in:
Henrik Hüttemann 2023-05-23 13:40:40 +02:00
parent 18985caab8
commit e241fa7491
No known key found for this signature in database
GPG Key ID: 9F7BD10E0A8A111E
3 changed files with 1238 additions and 4 deletions

View File

@ -1,9 +1,6 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"
npm run format
npm run lint
# THIS PART is generated by pre-commit: https://pre-commit.com
# start templated
@ -24,5 +21,6 @@ else
fi
### End of pre-commit py part
npx lint-staged
npm test
npm run compile

1229
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -8,10 +8,16 @@
"type": "git",
"url": "https://git.verdigado.com/NB-Public/rocketchat2matrix"
},
"lint-staged": {
"**/*.ts": [
"prettier --check",
"eslint --max-warnings 0"
]
},
"scripts": {
"format": "prettier 'src/**/*.ts' --check",
"format-fix": "prettier 'src/**/*.ts' --write",
"lint": "eslint src/ --ext .ts",
"lint": "eslint src/ --ext .ts --max-warnings 0",
"lint-fix": "eslint src/ --fix --ext .ts",
"prefix": "npm run format-fix",
"fix": "npm run lint-fix",
@ -33,6 +39,7 @@
"eslint-plugin-prettier": "^4.2.1",
"eslint-plugin-promise": "^6.1.1",
"husky": "^8.0.3",
"lint-staged": "^13.2.2",
"prettier": "2.8.8",
"typescript": "^5.0.4"
},