-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy patheslint.config.mjs
More file actions
95 lines (92 loc) · 2.9 KB
/
eslint.config.mjs
File metadata and controls
95 lines (92 loc) · 2.9 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
// For more info, see https://github.com/storybookjs/eslint-plugin-storybook#configuration-flat-config-format
import storybook from "eslint-plugin-storybook";
import { defineConfig, globalIgnores } from "eslint/config";
import nextVitals from "eslint-config-next/core-web-vitals";
import nextTs from "eslint-config-next/typescript";
import prettier from "eslint-config-prettier";
import boundaries from "eslint-plugin-boundaries";
const eslintConfig = defineConfig([
...nextVitals,
...nextTs,
// Override default ignores of eslint-config-next.
globalIgnores([
// Default ignores of eslint-config-next:
".next/**",
"out/**",
"build/**",
"storybook-static/**",
"debug-storybook.log",
"next-env.d.ts",
// Tooling configs (CommonJS)
"lighthouserc*.js",
"lighthouserc*.cjs",
// SST auto-generated / config
"sst.config.ts",
"sst-env.d.ts",
]),
{
plugins: { boundaries },
settings: {
"boundaries/elements": [
{ type: "shared", pattern: "src/shared/**" },
{ type: "entities", pattern: "src/entities/**" },
{ type: "features", pattern: "src/features/**" },
{ type: "widgets", pattern: "src/widgets/**" },
{ type: "app", pattern: "src/app/**" },
],
},
rules: {
eqeqeq: "error",
"boundaries/element-types": [
"error",
{
default: "disallow",
rules: [
{ from: "shared", allow: ["shared"] },
{ from: "entities", allow: ["shared", "entities"] },
{ from: "features", allow: ["shared", "entities", "features"] },
{ from: "widgets", allow: ["shared", "entities", "features", "widgets"] },
{ from: "app", allow: ["shared", "entities", "features", "widgets", "app"] },
],
},
],
"no-restricted-imports": [
"error",
{
patterns: [
{
group: [
"@/shared/*/*/*",
"@/shared/*/*/*/**",
"@/entities/*/*",
"@/entities/*/*/**",
"@/features/*/*",
"@/features/*/*/**",
"@/widgets/*/*",
"@/widgets/*/*/**",
],
message:
"FSD 규칙: 레이어 내부 직접 경로 대신 public index.ts를 통해 import 해야 합니다.",
},
],
},
],
"prefer-const": "error",
"@typescript-eslint/no-unused-vars": [
"warn",
{
argsIgnorePattern: "^_",
varsIgnorePattern: "^_",
caughtErrorsIgnorePattern: "^_",
},
],
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/explicit-function-return-type": "off",
"react-hooks/set-state-in-effect": "off",
"react-hooks/refs": "off",
},
},
prettier,
...storybook.configs["flat/recommended"]
]);
export default eslintConfig;