Skip to content

Commit

Permalink
feat: add husky & commitlint & lint-staged
Browse files Browse the repository at this point in the history
  • Loading branch information
bmstefanski committed Jan 1, 2025
1 parent 796fa3a commit f32ffc9
Show file tree
Hide file tree
Showing 7 changed files with 385 additions and 1 deletion.
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 --config commitlint.config.cjs --edit $1
1 change: 1 addition & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
lint-staged
3 changes: 3 additions & 0 deletions .lintstagedrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module.exports = {
"*.{ts,tsx,json,jsonc}": 'prettier --write "**/*.ts"',
};
3 changes: 2 additions & 1 deletion apps/storefront/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
"dev": "next dev --turbopack",
"build": "next build",
"start": "next start",
"format": "next lint --max-warnings 0",
"lint": "next lint --max-warnings 0",
"format": "prettier --write \"src/**/*.ts\" \"test/**/*.ts\"",
"check-types": "tsc --noEmit"
},
"dependencies": {
Expand Down
1 change: 1 addition & 0 deletions commitlint.config.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = { extends: ["@commitlint/config-conventional"] };
5 changes: 5 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
"name": "cavalier",
"private": true,
"scripts": {
"prepare": "husky install",
"pre-commit": "lint-staged",
"build": "turbo build",
"dev": "turbo dev",
"lint": "turbo lint",
Expand All @@ -18,12 +20,15 @@
"zod": "3.24.1"
},
"devDependencies": {
"@commitlint/config-conventional": "19.6.0",
"@types/node": "20.3.1",
"@typescript-eslint/eslint-plugin": "8.19.0",
"@typescript-eslint/parser": "8.19.0",
"eslint": "9.17.0",
"eslint-config-prettier": "9.1.0",
"eslint-plugin-prettier": "5.2.1",
"husky": "9.1.7",
"lint-staged": "15.3.0",
"prettier": "3.4.2",
"turbo": "2.3.3",
"typescript": "5.7.2"
Expand Down
Loading

0 comments on commit f32ffc9

Please sign in to comment.