-
Notifications
You must be signed in to change notification settings - Fork 3
/
eslint.config.js
87 lines (83 loc) · 2.54 KB
/
eslint.config.js
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
import globals from "globals";
import { createRequire } from "module";
const require = createRequire(import.meta.url);
const jsConfig = {
ignores: ["dist", "build", "public"],
languageOptions: {
ecmaVersion: 2020,
sourceType: "module",
parser: require("@typescript-eslint/parser"),
globals: {
...globals.browser,
...globals.node,
},
},
plugins: {
"@typescript-eslint": require("@typescript-eslint/eslint-plugin"),
"react-refresh": require("eslint-plugin-react-refresh"),
prettier: require("eslint-plugin-prettier"),
"react-hooks": require("eslint-plugin-react-hooks"),
//"eslint-plugin-react": require("eslint-plugin-react"),
},
rules: {
"react-refresh/only-export-components": ["warn", { allowConstantExport: true }],
"prettier/prettier": [
"warn",
{
endOfLine: "auto",
},
],
eqeqeq: "error",
curly: "error",
quotes: ["error", "double"],
"comma-style": ["error", "last"],
"no-unused-vars": ["off", { varsIgnorePattern: "^React$" }],
"no-console": "warn",
"no-extra-semi": "error",
// "no-unused-expressions": "error",
indent: "off", // prettier 충돌로 인해 off
semi: ["warn", "always"],
"no-undef": "error",
"no-trailing-spaces": "warn",
"no-multiple-empty-lines": "warn",
"arrow-spacing": "warn",
"no-const-assign": "error",
"no-multi-spaces": "error",
"prefer-const": "error",
"no-else-return": "warn",
"no-floating-decimal": "error",
"no-new-object": "error",
"no-param-reassign": "error",
"prefer-template": "warn",
radix: "error",
"no-useless-constructor": "error",
"no-alert": "warn",
"no-empty-pattern": "warn",
"no-eval": "error",
"no-implicit-globals": "error",
"no-implied-eval": "error",
"no-loop-func": "error",
"no-iterator": "error",
"no-new-wrappers": "error",
"no-restricted-globals": "error",
"no-return-assign": "warn",
"@typescript-eslint/no-explicit-any": "warn", // any 허용
"@typescript-eslint/no-unused-vars": ["off", { varsIgnorePattern: "^React$" }], // 'React' 사용 안해도 경고하지 않도록 설정
},
settings: {
react: {
version: "detect",
},
},
env: {
browser: true, // 브라우저 환경 전역 변수를 사용하도록 설정
},
};
const baseConfig = {
files: ["**/*.js", "**/*.ts", "**/*.jsx", "**/*.tsx"],
languageOptions: jsConfig.languageOptions,
plugins: jsConfig.plugins,
rules: jsConfig.rules,
settings: jsConfig.settings,
};
export default [baseConfig];