-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy path.eslintrc.cjs
70 lines (70 loc) · 2.26 KB
/
.eslintrc.cjs
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
module.exports = {
root: true,
env: { browser: true, es2020: true, node: true },
parser: '@typescript-eslint/parser',
plugins: ['react-refresh', 'react', 'react-hooks', '@typescript-eslint', 'prettier', 'import'],
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
'plugin:react/recommended',
'plugin:react-hooks/recommended',
'plugin:prettier/recommended',
'plugin:import/recommended',
'plugin:import/typescript',
'plugin:testing-library/react',
'plugin:vitest/recommended',
'plugin:jest-dom/recommended',
],
rules: {
'react-refresh/only-export-components': ['warn', { allowConstantExport: true }],
indent: ['error', 2, { SwitchCase: 1 }],
quotes: ['off', 'single'],
semi: ['error', 'always'],
'no-multiple-empty-lines': ['error', { max: 1, maxEOF: 0 }],
'no-multi-spaces': 'error',
'comma-dangle': ['error', 'always-multiline'],
'object-curly-spacing': ['error', 'always'],
'space-in-parens': ['error', 'never'],
'computed-property-spacing': ['error', 'never'],
'comma-spacing': ['error', { before: false, after: true }],
'eol-last': ['error', 'always'],
'react-hooks/rules-of-hooks': 'error',
'react-hooks/exhaustive-deps': 'warn',
'react/jsx-uses-react': 'off',
'react/react-in-jsx-scope': 'off',
'react/jsx-uses-vars': 'error',
'no-unused-vars': 'off',
'@typescript-eslint/no-unused-vars': 'warn',
'no-console': 'warn',
'require-await': 'error',
// import 규칙
'import/newline-after-import': ['error', { count: 1 }],
'import/order': [
'error',
{
groups: ['builtin', 'external', 'internal', ['parent', 'sibling', 'index'], 'object', 'type', 'unknown'],
alphabetize: {
order: 'asc',
caseInsensitive: true,
},
'newlines-between': 'always',
},
],
},
settings: {
'import/resolver': {
typescript: {},
node: {
moduleDirectory: ['node_modules', 'src/'],
extensions: ['.js', '.jsx', '.ts', '.tsx', '.d.ts'],
},
},
react: {
version: 'detect',
},
'import/parsers': {
'@typescript-eslint/parser': ['.ts', '.tsx', '.js'],
},
ignorePatterns: ['node_modules/', 'dist', '.eslintrc.cjs'],
},
};