-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.eslintrc.cjs
99 lines (99 loc) · 2.54 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
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
module.exports = {
root: true,
env: { browser: true, es2020: true },
extends: [
'airbnb',
'airbnb/hooks',
'airbnb-typescript',
'plugin:@typescript-eslint/recommended',
'plugin:prettier/recommended',
'plugin:react/recommended',
'plugin:react-hooks/recommended',
'plugin:react/jsx-runtime',
'eslint:recommended',
'plugin:import/typescript',
'plugin:import/recommended',
'plugin:promise/recommended',
'plugin:prettier/recommended',
],
ignorePatterns: ['dist', '.eslintrc.cjs', 'vite.config.ts'],
parser: '@typescript-eslint/parser',
parserOptions: {
project: './tsconfig.json',
ecmaFeatures: {
jsx: true,
},
ecmaVersion: 2020,
},
plugins: ['react', '@typescript-eslint', 'import', 'react-refresh', 'prettier'],
settings: {
react: {
version: 'detect',
},
},
rules: {
'react-refresh/only-export-components': ['warn', { allowConstantExport: true }],
'prettier/prettier': [
'error',
{
endOfLine: 'auto',
},
],
'no-restricted-exports': ['error', { restrictDefaultExports: { direct: true } }],
'@typescript-eslint/no-unused-vars': ['error', { vars: 'all', args: 'after-used', ignoreRestSiblings: false }],
'jsx-quotes': ['warn', 'prefer-double'],
quotes: ['error', 'single'],
'react/react-in-jsx-scope': 'off',
'import/prefer-default-export': 'off',
'react/function-component-definition': [
'error',
{
namedComponents: 'arrow-function',
unnamedComponents: 'arrow-function',
},
],
'react/require-default-props': ['error', { ignoreFunctionalComponents: true }],
'import/first': 'warn',
'import/no-unresolved': [
'error',
{
commonjs: true,
caseSensitive: true,
ignore: ['.svg'],
},
],
'react/boolean-prop-naming': ['error', { propTypeNames: ['bool', 'mutuallyExclusiveTrueProps'] }],
'@typescript-eslint/naming-convention': [
'error',
{
selector: 'interface',
format: ['PascalCase'],
prefix: ['I'],
filter: {
regex: '^(Global)$',
match: false,
},
},
{
selector: 'typeAlias',
format: ['PascalCase'],
prefix: ['T'],
},
{
selector: 'enumMember',
format: ['UPPER_CASE'],
},
{
selector: 'enum',
format: ['PascalCase'],
prefix: ['E'],
},
],
'react/jsx-props-no-spreading': [
'error',
{
exceptions: ['Tag'],
},
],
},
};