Skip to content

Commit

Permalink
build: setup pre-commit linting and code formatting. Closes #4
Browse files Browse the repository at this point in the history
  • Loading branch information
mattlewis92 committed Nov 3, 2023
1 parent f60e0fa commit 72f24b2
Show file tree
Hide file tree
Showing 3 changed files with 212 additions and 1 deletion.
4 changes: 4 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

pnpm lint-staged
14 changes: 13 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
"license": "MIT",
"private": true,
"scripts": {
"demo": "stmux -e '' -- [ \"pnpm nx build-esbuild demo --serve\" .. \"pnpm nx type-check demo\" ]"
"demo": "stmux -e '' -- [ \"pnpm nx build-esbuild demo --serve\" .. \"pnpm nx type-check demo\" ]",
"prepare": "husky install"
},
"devDependencies": {
"@angular-devkit/build-angular": "~16.2.0",
Expand Down Expand Up @@ -53,10 +54,12 @@
"eslint": "~8.46.0",
"eslint-config-prettier": "^9.0.0",
"express": "^4.18.2",
"husky": "^8.0.3",
"jest": "^29.4.1",
"jest-environment-jsdom": "^29.4.1",
"jest-preset-angular": "~13.1.0",
"jsonc-eslint-parser": "^2.1.0",
"lint-staged": "^15.0.2",
"lodash": "^4.17.21",
"nx": "17.0.2",
"open": "^8.0.4",
Expand Down Expand Up @@ -91,5 +94,14 @@
},
"nx": {
"includedScripts": []
},
"lint-staged": {
"*.ts": [
"eslint --fix",
"prettier --write"
],
"*.{js,json,yml,md}": [
"prettier --write"
]
}
}
Loading

0 comments on commit 72f24b2

Please sign in to comment.