Skip to content

Commit 9ac1cb6

Browse files
committed
install lefthook s.t. I don't accidentally commit unformatted changes
1 parent bbeb6a2 commit 9ac1cb6

File tree

3 files changed

+176
-2
lines changed

3 files changed

+176
-2
lines changed

lefthook.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
pre-commit:
2+
parallel: true
3+
commands:
4+
eslint:
5+
glob: "*.{js,ts,jsx,tsx,md,mdx}"
6+
run: npm run lint # not doing fix to prevent implicit behaviour potentially breaking something
7+
exclude: "contents"
8+
# stage_fixed: true # ↑を lint:fix に変更する場合、これを uncomment すること

package-lock.json

Lines changed: 164 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@
1414
"serve": "gatsby serve",
1515
"clean": "gatsby clean",
1616
"lint": "eslint .",
17-
"type-check": "tsc --noEmit"
17+
"type-check": "tsc --noEmit",
18+
"prepare": "lefthook install"
1819
},
1920
"dependencies": {
2021
"@headlessui/react": "^1.7.18",
@@ -49,9 +50,10 @@
4950
"eslint": "^8.56.0",
5051
"eslint-config-airbnb-typescript-prettier": "^5.0.0",
5152
"gatsby-plugin-postcss": "^6.13.1",
53+
"lefthook": "^1.9.2",
5254
"postcss": "^8.4.33",
5355
"prettier": "^2.8.8",
5456
"tailwindcss": "^3.4.1",
5557
"typescript": "5.1.6"
5658
}
57-
}
59+
}

0 commit comments

Comments
 (0)