Skip to content

Commit

Permalink
build: setup git hooks with eslint, prettier and commitlint
Browse files Browse the repository at this point in the history
  • Loading branch information
Amgelo563 committed Oct 20, 2024
1 parent c54cf51 commit 10138b2
Show file tree
Hide file tree
Showing 6 changed files with 1,006 additions and 7 deletions.
1 change: 1 addition & 0 deletions .husky/commit-msg
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
pnpm dlx commitlint --edit \
1 change: 1 addition & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
pnpm exec lint-staged
1 change: 1 addition & 0 deletions commitlint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export default { extends: ['@commitlint/config-conventional'] };
2 changes: 1 addition & 1 deletion eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export default typescriptEslint.config(
...typescriptEslint.configs.recommended,
prettierConfig,
{
ignores: ['dist/', 'eslint.config.mjs'],
ignores: ['dist/', 'eslint.config.mjs', 'commitlint.config.js'],
rules: {
// Eslint rules
'lines-between-class-members': ['error', 'always'],
Expand Down
17 changes: 15 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,12 @@
"scripts": {
"clean": "rimraf ./dist",
"lint": "eslint src",
"format": "prettier --write src",
"build": "pnpm run clean && pnpm run prisma:gen && tsc",
"start": "node --trace-deprecation -r source-map-support/register dist/index.js",
"prisma:gen": "prisma generate",
"prisma:push": "prisma db push"
"prisma:push": "prisma db push",
"prepare": "husky || true"
},
"license": "MIT",
"dependencies": {
Expand All @@ -33,19 +35,30 @@
"zod-validation-error": "3.4.0"
},
"devDependencies": {
"@commitlint/cli": "19.5.0",
"@commitlint/config-conventional": "19.5.0",
"@commitlint/types": "19.5.0",
"@eslint/js": "9.7.0",
"@types/eslint__js": "8.42.3",
"@typescript-eslint/eslint-plugin": "8.6.0",
"@typescript-eslint/parser": "8.6.0",
"eslint": "9.7.0",
"eslint-config-prettier": "9.1.0",
"globals": "15.8.0",
"husky": "9.1.6",
"lint-staged": "15.2.10",
"prettier": "3.3.2",
"typescript": "5.5.4",
"typescript-eslint": "8.6.0"
},
"engines": {
"node": ">=20.0.0"
},
"packageManager": "[email protected]"
"packageManager": "[email protected]",
"lint-staged": {
"*.ts": [
"pnpm format",
"pnpm lint --fix"
]
}
}
Loading

0 comments on commit 10138b2

Please sign in to comment.