Skip to content

Commit 6773f62

Browse files
committedSep 24, 2024
v2
1 parent c4fcd08 commit 6773f62

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

70 files changed

+3814
-2352
lines changed
 

‎.eslintrc.js

+25-71
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,14 @@
1+
/** @type {import("eslint").Linter.Config} */
12
module.exports = {
23
root: true,
3-
env: {
4-
es6: true,
5-
node: true,
6-
browser: true,
7-
"shared-node-browser": true,
8-
},
9-
ignorePatterns: ["node_modules/*", "build/*", "dist/*", ".next/*"],
10-
11-
// ts, 최신 js, 모듈, JSX 파싱 설정
12-
parser: "@typescript-eslint/parser",
13-
parserOptions: {
14-
ecmaVersion: "latest",
15-
sourceType: "module",
16-
ecmaFeatures: { jsx: true },
17-
},
184

19-
extends: [
20-
"eslint:recommended",
21-
"plugin:@typescript-eslint/recommended",
22-
"plugin:react/recommended",
23-
"plugin:react-hooks/recommended",
24-
"plugin:import/recommended", // errors + warnings
25-
"plugin:prettier/recommended",
26-
"next/core-web-vitals",
27-
],
28-
plugins: ["@typescript-eslint", "react", "react-hooks", "import", "sort-exports", "prettier"],
5+
// https://nextjs.org/docs/app/building-your-application/configuring/eslint
6+
extends: ["next/core-web-vitals", "next/typescript", "prettier"],
297

30-
settings: {
31-
"import/resolver": { typescript: {} },
32-
next: {
33-
rootDir: ["apps/*/"],
34-
},
35-
},
368
rules: {
37-
"no-implicit-coercion": "error", // 암시적 타입 변환을 금지
38-
39-
curly: ["error", "all"], // 모든 제어문 중괄호
409
eqeqeq: ["error", "always", { null: "ignore" }], // 동등 비교(===, !==)를 사용. null 제외
41-
10+
"@typescript-eslint/consistent-type-imports": "error", // import type을 사용하도록 강제
11+
"@typescript-eslint/no-empty-object-type": "warn",
4212
"import/order": [
4313
"error",
4414
{
@@ -54,45 +24,29 @@ module.exports = {
5424
group: "external",
5525
position: "before",
5626
},
27+
{
28+
pattern: "@/lib/**/*",
29+
group: "external",
30+
position: "after",
31+
},
32+
{
33+
pattern: "@/hooks/**/*",
34+
group: "external",
35+
position: "after",
36+
},
37+
{
38+
pattern: "@/components/**/*",
39+
group: "external",
40+
position: "after",
41+
},
42+
{
43+
pattern: "@/constants/**/*",
44+
group: "external",
45+
position: "after",
46+
},
5747
],
5848
pathGroupsExcludedImportTypes: ["react", "next"],
5949
},
6050
],
61-
"sort-exports/sort-exports": ["error", { sortDir: "asc", pattern: "**/index.ts" }],
62-
63-
"@typescript-eslint/naming-convention": [
64-
"error",
65-
{
66-
format: ["camelCase", "UPPER_CASE", "PascalCase"],
67-
selector: "variable",
68-
leadingUnderscore: "allow",
69-
},
70-
{ format: ["camelCase", "PascalCase"], selector: "function" },
71-
{ format: ["PascalCase"], selector: "interface" },
72-
{ format: ["PascalCase"], selector: "typeAlias" },
73-
],
74-
"@typescript-eslint/member-ordering": [
75-
"error",
76-
{
77-
default: [
78-
"public-static-field",
79-
"private-static-field",
80-
"public-instance-field",
81-
"private-instance-field",
82-
"public-constructor",
83-
"private-constructor",
84-
"public-instance-method",
85-
"private-instance-method",
86-
],
87-
},
88-
],
89-
// ...rest 제외 사용하지 않는 변수 에러
90-
"@typescript-eslint/no-unused-vars": ["error", { ignoreRestSiblings: true }],
91-
92-
"react/react-in-jsx-scope": "off", // React 17 이상에서 불필요
93-
"react/display-name": "off", // React.memo, React.forwardRef 때문에 끔
94-
"react/no-unknown-property": ["error"],
95-
96-
"prettier/prettier": ["warn"],
9751
},
9852
};

‎.husky/pre-commit

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
npx lint-staged
1+
pnpm lint-staged

0 commit comments

Comments
 (0)