Skip to content

Commit

Permalink
Add commit lint hook
Browse files Browse the repository at this point in the history
  • Loading branch information
Qwreey committed Nov 20, 2023
1 parent 3fb5d7f commit 42fa894
Show file tree
Hide file tree
Showing 8 changed files with 1,449 additions and 839 deletions.
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
19 changes: 19 additions & 0 deletions backend/.eslintrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
env:
browser: true
es2021: true
extends:
- prettier
- eslint:recommended
- plugin:@typescript-eslint/recommended
parser: "@typescript-eslint/parser"
parserOptions:
ecmaVersion: latest
sourceType: module
plugins:
- "@typescript-eslint"
- "prettier"
rules:
prettier/prettier: error
ignorePatterns:
- dist
- .eslintrc.cjs
1 change: 1 addition & 0 deletions backend/.lintstagedrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{ "*.{js,ts,jsx,tsx}": "eslint --fix" }
2 changes: 1 addition & 1 deletion backend/index.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
import fastify from "fastify"
// import fastify from "fastify"
9 changes: 8 additions & 1 deletion backend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
"version": "0.0.1",
"scripts": {
"dev": "tsup --watch --onSuccess 'node dist/index.js'",
"prepack": "tsup"
"prepack": "tsup",
"lint": "eslint ."
},
"dependencies": {
"@fastify/type-provider-typebox": "^3.5.0",
Expand All @@ -13,6 +14,12 @@
},
"devDependencies": {
"@types/node": "^20.9.2",
"@typescript-eslint/eslint-plugin": "^6.12.0",
"@typescript-eslint/parser": "^6.12.0",
"eslint": "^8.54.0",
"eslint-config-prettier": "^9.0.0",
"eslint-plugin-prettier": "^5.0.1",
"prettier": "^3.1.0",
"tsup": "^8.0.0"
},
"files": [
Expand Down
1 change: 1 addition & 0 deletions frontend/.lintstagedrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{ "*.{js,ts,jsx,tsx}": "eslint --fix" }
7 changes: 5 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,13 @@
"private": false,
"scripts": {
"dev": "pnpm run -r --parallel dev",
"lint": "",
"format": "prettier --ignore-path .gitignore -w ."
"lint": "pnpm run -r --parallel lint",
"format": "prettier --ignore-path .gitignore -w .",
"prepare": "husky install"
},
"devDependencies": {
"husky": "^8.0.0",
"lint-staged": "^15.1.0",
"prettier": "^3.1.0"
}
}
Loading

0 comments on commit 42fa894

Please sign in to comment.