Skip to content

Commit 00c5fc4

Browse files
committed
setup husky
1 parent d3211c5 commit 00c5fc4

8 files changed

+42
-12
lines changed

.eslintrc.json

+5-7
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,12 @@
88
"ecmaVersion": "latest",
99
"sourceType": "module"
1010
},
11-
"plugins": [
12-
"@typescript-eslint"
13-
],
11+
"plugins": ["@typescript-eslint"],
1412
"extends": [
1513
"plugin:@typescript-eslint/recommended",
1614
"plugin:@typescript-eslint/recommended-requiring-type-checking",
17-
"next/core-web-vitals"
15+
"next/core-web-vitals",
16+
"prettier"
1817
],
19-
"rules": {
20-
}
21-
}
18+
"rules": {}
19+
}

.husky/pre-push

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#!/usr/bin/env sh
2+
. "$(dirname -- "$0")/_/husky.sh"
3+
4+
yarn prettier
5+
yarn lint

.prettierignore

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
**/node_modules/*
2+
dist
3+
coverage
4+
**/.next/*
5+
*.lock
6+
*.css
7+
*.scss
8+
**/out/*
9+
next-env.d.ts
10+
next.config.js
11+
*.md

next.config.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
/** @type {import('next').NextConfig} */
2-
const nextConfig = {}
2+
const nextConfig = {};
33

4-
module.exports = nextConfig
4+
module.exports = nextConfig;

package.json

+7-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@
66
"dev": "next dev",
77
"build": "next build",
88
"start": "next start",
9-
"lint": "next lint"
9+
"lint": "next lint",
10+
"prettier": "prettier . --write",
11+
"prepare": "husky install"
1012
},
1113
"dependencies": {
1214
"@reduxjs/toolkit": "^1.9.5",
@@ -26,8 +28,11 @@
2628
"daisyui": "^3.5.0",
2729
"eslint": "8.46.0",
2830
"eslint-config-next": "13.4.12",
31+
"eslint-config-prettier": "^8.10.0",
2932
"postcss": "8.4.27",
33+
"prettier": "^3.0.1",
3034
"tailwindcss": "3.3.3",
31-
"typescript": "5.1.6"
35+
"typescript": "5.1.6",
36+
"husky": "^8.0.0"
3237
}
3338
}

postcss.config.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ module.exports = {
33
tailwindcss: {},
44
autoprefixer: {},
55
},
6-
}
6+
};

src/app/counter/page.tsx

+1
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ function CounterPage() {
3434
</button>
3535
</div>
3636
{value}
37+
<img src="" />
3738
</div>
3839
);
3940
}

yarn.lock

+10
Original file line numberDiff line numberDiff line change
@@ -963,6 +963,11 @@ [email protected]:
963963
eslint-plugin-react "^7.31.7"
964964
eslint-plugin-react-hooks "5.0.0-canary-7118f5dd7-20230705"
965965

966+
eslint-config-prettier@^8.10.0:
967+
version "8.10.0"
968+
resolved "https://registry.yarnpkg.com/eslint-config-prettier/-/eslint-config-prettier-8.10.0.tgz#3a06a662130807e2502fc3ff8b4143d8a0658e11"
969+
integrity sha512-SM8AMJdeQqRYT9O9zguiruQZaN7+z+E4eAP9oiLNGKMtomwaB1E9dcgUD6ZAn/eQAb52USbvezbiljfZUhbJcg==
970+
966971
eslint-import-resolver-node@^0.3.6, eslint-import-resolver-node@^0.3.7:
967972
version "0.3.7"
968973
resolved "https://registry.yarnpkg.com/eslint-import-resolver-node/-/eslint-import-resolver-node-0.3.7.tgz#83b375187d412324a1963d84fa664377a23eb4d7"
@@ -2195,6 +2200,11 @@ prelude-ls@^1.2.1:
21952200
resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.2.1.tgz#debc6489d7a6e6b0e7611888cec880337d316396"
21962201
integrity sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==
21972202

2203+
prettier@^3.0.1:
2204+
version "3.0.1"
2205+
resolved "https://registry.yarnpkg.com/prettier/-/prettier-3.0.1.tgz#65271fc9320ce4913c57747a70ce635b30beaa40"
2206+
integrity sha512-fcOWSnnpCrovBsmFZIGIy9UqK2FaI7Hqax+DIO0A9UxeVoY4iweyaFjS5TavZN97Hfehph0nhsZnjlVKzEQSrQ==
2207+
21982208
prop-types@^15.8.1:
21992209
version "15.8.1"
22002210
resolved "https://registry.yarnpkg.com/prop-types/-/prop-types-15.8.1.tgz#67d87bf1a694f48435cf332c24af10214a3140b5"

0 commit comments

Comments
 (0)