-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patheslint.config.js
More file actions
98 lines (91 loc) Β· 2.6 KB
/
eslint.config.js
File metadata and controls
98 lines (91 loc) Β· 2.6 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
import eslintConfigPrettier from 'eslint-config-prettier'
import importPlugin from 'eslint-plugin-import'
import react from 'eslint-plugin-react'
import reactHooks from 'eslint-plugin-react-hooks'
import globals from 'globals'
import tseslint from 'typescript-eslint'
export default tseslint.config(
// 1. Global Ignores: νλ‘μ νΈ μ 체μμ λ¦°νΈλ₯Ό 무μν νμΌ/ν΄λ
{
ignores: [
'node_modules',
'.expo',
'dist',
'babel.config.cjs', // .cjs νμ₯μλ‘ λ μ€μ νμΌλ€μ 무μ
'tailwind.config.cjs',
'metro.config.cjs',
'.prettierrc.cjs',
],
},
// 2. κΈ°λ³Έ κΆμ₯ μ€μ
...tseslint.configs.recommended,
// 3. νλ‘μ νΈ λ£¨νΈμ μ€μ νμΌ(.cjs)μ μν κ·μΉ
{
files: ['*.cjs'], // 루νΈμ .cjs νμΌμλ§ μ΄ κ·μΉμ μ μ©
rules: {
// μ€μ νμΌμμλ require() ꡬ문 μ¬μ©μ νμ©
'@typescript-eslint/no-require-imports': 'off',
},
},
// 4. νλ‘μ νΈ μμ€ μ½λ 컀μ€ν
μ€μ
{
files: ['**/*.{js,jsx,ts,tsx}'], // μ±μ λͺ¨λ μμ€ μ½λμ μ μ©
plugins: {
import: importPlugin,
react: react,
'react-hooks': reactHooks,
},
languageOptions: {
globals: {
...globals.browser,
...globals.node,
},
},
settings: {
react: { version: 'detect' },
'import/resolver': {
typescript: {
alwaysTryTypes: true,
project: './tsconfig.json',
},
node: {
extensions: ['.js', '.jsx', '.ts', '.tsx'],
},
},
},
rules: {
// νμ κ·μΉ
'react/react-in-jsx-scope': 'off',
'react-hooks/exhaustive-deps': 'warn',
// μ½λ νμ§ κ·μΉ (μλ¬ λμ κ²½κ³ λ‘)
'@typescript-eslint/no-unused-vars': [
'warn',
{ argsIgnorePattern: '^_' },
],
'@typescript-eslint/no-explicit-any': 'warn',
// μ€νμΌ/컨벀μ
κ·μΉ (μλ¬ λμ κ²½κ³ λ‘)
'import/order': [
'warn',
{
groups: [
'builtin',
'external',
'internal',
'parent',
'sibling',
'index',
],
pathGroups: [
{ pattern: 'react', group: 'external', position: 'before' },
{ pattern: '@/**', group: 'internal' },
],
pathGroupsExcludedImportTypes: ['react'],
'newlines-between': 'always',
alphabetize: { order: 'asc', caseInsensitive: true },
},
],
},
},
// 5. Prettier μ€μ (νμ λ§μ§λ§μ μμΉ)
eslintConfigPrettier
)