-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patheslint.config.js
More file actions
104 lines (94 loc) · 2.69 KB
/
Copy patheslint.config.js
File metadata and controls
104 lines (94 loc) · 2.69 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
96
97
98
99
100
101
102
103
104
import js from '@eslint/js'
import eslintConfigPrettier from 'eslint-config-prettier'
import tseslint from 'typescript-eslint'
import unusedImports from 'eslint-plugin-unused-imports'
import react from 'eslint-plugin-react'
import reactHooks from 'eslint-plugin-react-hooks'
import tanstackQuery from '@tanstack/eslint-plugin-query'
/**
* React 프로젝트용 ESLint 통합 설정
*/
export default [
{
ignores: [
'dist/**',
'build/**',
'node_modules/**',
'*.config.js',
'*.config.cjs',
'**/*.js',
'tailwind.config.ts'
]
},
// 기본 설정들
js.configs.recommended,
...tseslint.configs.recommended,
react.configs.flat.recommended,
react.configs.flat['jsx-runtime'],
eslintConfigPrettier,
...tanstackQuery.configs['flat/recommended'],
// 메인 설정
{
files: ['**/*.{ts,tsx,js,jsx}'],
plugins: {
'unused-imports': unusedImports,
react,
'react-hooks': reactHooks
},
settings: {
react: {
version: 'detect'
}
},
languageOptions: {
ecmaVersion: 'latest',
sourceType: 'module',
parserOptions: {
ecmaFeatures: {
jsx: true
},
project: true,
tsconfigRootDir: import.meta.dirname
}
},
rules: {
// React Hook 규칙들
...reactHooks.configs.recommended.rules,
// React 17+ JSX Transform 대응 (이미 jsx-runtime 설정에서 처리되지만 명시적으로 유지)
'react/react-in-jsx-scope': 'off',
'react/jsx-uses-react': 'off',
// Arrow function 강제 설정
'arrow-body-style': 'off',
'prefer-arrow-callback': 'error',
'react/function-component-definition': [
'error',
{
namedComponents: 'arrow-function',
unnamedComponents: 'arrow-function'
}
],
// 미사용 import/변수 처리
'unused-imports/no-unused-imports': 'error',
'@typescript-eslint/no-unused-vars': 'off',
'unused-imports/no-unused-vars': [
'warn',
{
vars: 'all',
varsIgnorePattern: '^_',
args: 'after-used',
argsIgnorePattern: '^_'
}
],
// TypeScript 엄격한 규칙들 완화
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-unsafe-function-type': 'off',
'@typescript-eslint/no-empty-object-type': 'off',
'@typescript-eslint/no-wrapper-object-types': 'off',
// 환경별 변수 허용
'no-undef': 'off',
// React 추가 규칙들
'react/prop-types': 'off', // TypeScript 사용시 불필요
'react/display-name': 'off' // arrow function에서는 불필요한 경우가 많음
}
}
]