-
Notifications
You must be signed in to change notification settings - Fork 16
/
.eslintrc.js
95 lines (91 loc) · 2.96 KB
/
.eslintrc.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
88
89
90
91
92
93
94
95
module.exports = {
env: { browser: true, es6: true, node: true },
extends: [
'eslint:recommended',
'plugin:react/recommended',
'plugin:@typescript-eslint/eslint-recommended',
'plugin:@typescript-eslint/recommended',
'plugin:prettier/recommended',
],
parser: '@typescript-eslint/parser',
parserOptions: {
ecmaFeatures: { jsx: true },
ecmaVersion: 2020,
project: ['./tsconfig.json'],
sourceType: 'module',
},
plugins: ['@typescript-eslint', 'jsx-a11y', 'react-hooks', 'react', 'unused-imports', 'simple-import-sort', 'prettier'],
rules: {
'@typescript-eslint/consistent-type-imports': 'error',
'@typescript-eslint/method-signature-style': 'error',
'@typescript-eslint/naming-convention': [
'error',
{
selector: 'interface',
format: ['PascalCase'],
custom: { regex: '^I[A-Z]', match: false },
},
],
'@typescript-eslint/no-empty-function': 'off',
'@typescript-eslint/no-explicit-any': 'warn',
'@typescript-eslint/no-redeclare': 'warn',
'@typescript-eslint/no-unused-vars': 'off',
'@typescript-eslint/ban-ts-comment': 'off',
'@typescript-eslint/ban-types': 'off',
'@typescript-eslint/explicit-function-return-type': 'off',
'@typescript-eslint/no-empty-interface': 'off',
'react/jsx-filename-extension': ['warn', { extensions: ['.jsx', '.tsx'] }],
'react/no-unescaped-entities': 'off',
'react/jsx-no-useless-fragment': 'off',
'react/react-in-jsx-scope': 'off',
'react-hooks/rules-of-hooks': 'error',
'react-hooks/exhaustive-deps': 'warn',
'react/jsx-uses-react': 'off',
'react/prop-types': 'off',
'new-cap': ['warn', { properties: false }],
'no-redeclare': 'off',
'jsx-a11y/aria-role': ['warn', { ignoreNonDOM: true }],
'arrow-body-style': 'off',
'consistent-return': 'off',
'import/no-default-export': 'off',
'import/prefer-default-export': 'off',
'jsx-a11y/anchor-is-valid': 'off',
'no-console': ['error', { allow: ['warn', 'error'] }],
'no-nested-ternary': 'off',
'no-underscore-dangle': 'off',
'no-extra-boolean-cast': 'off',
radix: 'off',
// Unused imports rules
'unused-imports/no-unused-imports': 'error',
'unused-imports/no-unused-vars': [
'warn',
{
varsIgnorePattern: '^_',
args: 'none',
argsIgnorePattern: '^_',
ignoreRestSiblings: true,
},
],
// Import ordering rules
'simple-import-sort/imports': [
'warn',
{
groups: [
// Side effect imports
['^\\u0000'],
// React Package(s) comes first as seperate group
['^react(-dom(/client)?)?$'],
// All other imports
['^@?\\w'],
['^((?!\\u0000$)|/.*|$)'],
['^\\.'],
// Type imports: keep these last!
['^@?\\w.*\\u0000$'],
['^.*\\u0000$'],
['^\\..*\\u0000$'],
],
},
],
},
settings: { react: { version: 'detect' } },
}