Skip to content

Commit

Permalink
feat: SB-815 husky with pre-commit hook
Browse files Browse the repository at this point in the history
  • Loading branch information
ingrqm-apptension committed Feb 28, 2023
1 parent a3bae58 commit f5d46ad
Show file tree
Hide file tree
Showing 6 changed files with 149 additions and 285 deletions.
9 changes: 9 additions & 0 deletions .husky/pre-commit
@@ -0,0 +1,9 @@
#!/bin/sh

[ -n "$CI" ] && exit 0

. "$(dirname "$0")/_/husky.sh"

echo "🚀 Running pre-commit tasks 🚀"
npx lint-staged --allow-empty
echo "🏁 Finished pre-commit tasks 🏁"
4 changes: 4 additions & 0 deletions .lintstagedrc
@@ -0,0 +1,4 @@
{
"*.{ts,tsx}": "eslint --fix",
"*.{json,md,html}": "prettier --write"
}
21 changes: 12 additions & 9 deletions package.json
Expand Up @@ -5,7 +5,8 @@
"private": true,
"scripts": {
"aws-vault:shell": "aws-vault exec $AWS_VAULT_PROFILE -- $SHELL",
"login:qa": "env-cmd -f .env.qa npm run aws-vault:shell"
"login:qa": "env-cmd -f .env.qa npm run aws-vault:shell",
"prepare": "husky install"
},
"devDependencies": {
"@nrwl/devkit": "15.6.3",
Expand All @@ -21,20 +22,22 @@
"@swc/core": "^1.2.173",
"@swc/helpers": "~0.4.11",
"@types/node": "16.11.7",
"@typescript-eslint/eslint-plugin": "^5.51.0",
"@typescript-eslint/parser": "^5.51.0",
"babel-plugin-relay": "^14.1.0",
"env-cmd": "^10.1.0",
"eslint": "^8.34.0",
"eslint-config-prettier": "^8.5.0",
"eslint-import-resolver-typescript": "^3.5.3",
"eslint-plugin-import": "npm:eslint-plugin-i@^2.26.0",
"husky": "^8.0.0",
"jsonc-eslint-parser": "^2.1.0",
"lint-staged": "^10.5.4",
"nx": "^15.4.5",
"prettier": "^2.6.2",
"tsconfig-paths": "^4.1.2",
"ts-node": "10.9.1",
"tsconfig-paths": "^4.1.2",
"tslib": "^2.3.0",
"typescript": "~4.8.2",
"@typescript-eslint/eslint-plugin": "^5.51.0",
"@typescript-eslint/parser": "^5.51.0",
"eslint": "^8.34.0",
"eslint-config-prettier": "^8.5.0",
"eslint-plugin-import": "npm:eslint-plugin-i@^2.26.0",
"eslint-import-resolver-typescript": "^3.5.3"
"typescript": "~4.8.2"
}
}
16 changes: 0 additions & 16 deletions packages/e2e-tests/package.json
Expand Up @@ -31,27 +31,11 @@
"eslint-plugin-prettier": "^3.1.4",
"eslint-plugin-react": "^7.21.5",
"eslint-plugin-react-hooks": "^4.0.0",
"husky": "^4.3.8",
"lint-staged": "^10.5.4",
"mochawesome": "^6.2.1",
"mochawesome-merge": "^4.2.0",
"mochawesome-report-generator": "^5.1.0",
"prettier": "^2.2.1"
},
"husky": {
"hooks": {
"pre-commit": "lint-staged"
}
},
"lint-staged": {
"*.js": [
"eslint",
"prettier --write"
],
"*.{json,md,html}": [
"prettier --write"
]
},
"repository": {
"type": "git",
"url": ""
Expand Down
3 changes: 0 additions & 3 deletions packages/webapp/.lintstagedrc

This file was deleted.

0 comments on commit f5d46ad

Please sign in to comment.