-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintrc.cjs
136 lines (136 loc) · 4.03 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
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
module.exports = {
root: true,
env: { browser: true, es2020: true },
extends: [
'eslint:recommended',
'plugin:react/recommended',
'plugin:@typescript-eslint/recommended',
'plugin:react-hooks/recommended',
'plugin:@typescript-eslint/recommended',
'plugin:@typescript-eslint/recommended-requiring-type-checking',
],
ignorePatterns: ['dist', '.eslintrc.cjs'],
parser: '@typescript-eslint/parser',
globals: {
Atomics: 'readonly',
SharedArrayBuffer: 'readonly',
},
parserOptions: {
project: './tsconfig.json',
ecmaFeatures: {
jsx: true,
},
ecmaVersion: 2018,
sourceType: 'module',
},
plugins: [
'simple-import-sort',
'import',
'sort-keys-fix',
'@typescript-eslint',
'react',
'react-hooks',
'@typescript-eslint',
'prettier',
'react-refresh',
],
rules: {
'react-refresh/only-export-components': [
'warn',
{ allowConstantExport: true },
],
'linebreak-style': ['error', 'crlf'],
quotes: 'off',
'no-empty-function': 'off',
'@typescript-eslint/no-empty-function': 'off',
'import/order': ['error', { groups: ['builtin', 'external', 'internal'] }],
'sort-keys': ['error', 'asc', { caseSensitive: true, natural: false }],
'@typescript-eslint/restrict-plus-operands': 'off',
'prettier/prettier': 'error',
'@typescript-eslint/explicit-module-boundary-types': 'off',
'sort-keys-fix/sort-keys-fix': 'warn',
'no-console': 'warn',
'react/react-in-jsx-scope': 'off',
'no-debugger': 2,
'simple-import-sort/imports': 'error',
'no-multiple-empty-lines': [
2,
{
max: 1,
maxEOF: 0,
maxBOF: 0,
},
],
'no-unreachable': 1,
'no-case-declarations': [1],
'space-before-function-paren': 'off',
'no-return-assign': [1],
'guard-for-in': 2,
'spaced-comment': [1, 'always'],
'valid-typeof': 2,
'@typescript-eslint/no-unused-vars': [
'error',
{ varsIgnorePattern: '_', argsIgnorePattern: '_' },
],
'@typescript-eslint/ban-ts-ignore': 0,
'@typescript-eslint/ban-ts-comment': 0,
'@typescript-eslint/no-var-requires': 0,
'@typescript-eslint/camelcase': 'off',
'react/no-unsafe': 0,
'react/self-closing-comp': [
1,
{
component: true,
html: true,
},
],
'react/prop-types': [0],
'react/display-name': 0,
'react/no-children-prop': 2,
'react/no-deprecated': 2,
'react/no-direct-mutation-state': 1,
'react/no-is-mounted': 1,
'react/boolean-prop-naming': [
2,
{
rule: '^(is|has|show)[A-Z]([A-Za-z0-9]?)+',
},
],
'react/react-in-jsx-scope': 'off',
'react/require-render-return': 2,
'react/jsx-closing-tag-location': 1,
'react/jsx-equals-spacing': 1,
'react/jsx-wrap-multilines': 1,
'react/jsx-no-comment-textnodes': 1,
'react/jsx-no-undef': 2,
'react/jsx-no-useless-fragment': 1,
'react/jsx-pascal-case': 2,
'react/jsx-tag-spacing': 1,
'react/jsx-uses-react': 2,
'react/jsx-no-duplicate-props': 1,
'react-hooks/rules-of-hooks': 2,
'react-hooks/exhaustive-deps': 2,
'@typescript-eslint/explicit-function-return-type': 'off',
'@typescript-eslint/no-use-before-define': 'off',
'no-use-before-define': 'off',
'simple-import-sort/imports': 'error',
'import/newline-after-import': [
'error',
{
count: 1,
},
],
'@typescript-eslint/no-unsafe-assignment': 'off',
'@typescript-eslint/no-misused-promises': 'off',
'@typescript-eslint/no-unsafe-member-access': 'off',
'@typescript-eslint/no-unsafe-call': 'off',
'@typescript-eslint/no-unsafe-return': 'off',
'@typescript-eslint/no-floating-promises': 'off',
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-non-null-assertion': 'off',
'@typescript-eslint/restrict-template-expressions': 'off',
'react/no-unknown-property': 'off',
'@typescript-eslint/no-redundant-type-constituents': 'off',
'@typescript-eslint/no-unsafe-enum-comparison': 'off',
},
};