-
Notifications
You must be signed in to change notification settings - Fork 7
/
.eslintrc.js
180 lines (180 loc) · 4.43 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
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
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
module.exports = {
env: {
commonjs: true,
node: false,
browser: true,
es6: true,
},
globals: {
React: true,
expect: true,
JSX: true,
},
extends: [
'airbnb',
'erb',
'eslint:recommended',
'plugin:@typescript-eslint/eslint-recommended',
'plugin:@typescript-eslint/recommended',
'plugin:react/recommended',
'plugin:@typescript-eslint/recommended',
'plugin:@typescript-eslint/recommended-requiring-type-checking',
'plugin:@typescript-eslint/strict',
],
plugins: ['@typescript-eslint', 'react', 'jsx-a11y'],
parser: '@typescript-eslint/parser',
parserOptions: {
ecmaVersion: 2022,
sourceType: 'module',
project: './tsconfig.json',
tsconfigRootDir: __dirname,
createDefaultProgram: true,
},
settings: {
'import/resolver': {
typescript: {},
},
'import/parsers': {
'@typescript-eslint/parser': ['.ts', '.tsx'],
},
},
rules: {
'class-methods-use-this': 0,
eqeqeq: 2,
'import/extensions': [
2,
'ignorePackages',
{
ts: 'never',
tsx: 'never',
},
],
'import/no-cycle': 2,
'import/no-extraneous-dependencies': 0,
'import/no-unresolved': 2,
'import/prefer-default-export': 2,
'jsx-a11y/label-has-for': 0,
'jsx-a11y/click-events-have-key-events': 0,
'jsx-a11y/no-static-element-interactions': 0,
'max-classes-per-file': 2,
'no-await-in-loop': 2,
'no-console': [2, { allow: ['info', 'trace'] }],
'no-constructor-return': 0,
'no-invalid-this': 2,
'no-non-null-assertion': 0,
'no-unused-vars': 2,
'no-param-reassign': [2, { props: false }],
'no-plusplus': 0,
'no-restricted-modules': 2,
'no-shadow': 0,
'no-throw-literal': 2,
'no-trailing-spaces': 2,
'no-underscore-dangle': 0,
'no-var': 2,
'object-curly-newline': [
2,
{
consistent: true,
},
],
'prefer-const': 2,
'prefer-template': 2,
'react/react-in-jsx-scope': 2,
'react/function-component-definition': [
'error',
{
namedComponents: ['function-declaration', 'arrow-function'],
unnamedComponents: 'arrow-function',
},
],
'react/jsx-filename-extension': [
2,
{
extensions: ['.tsx'],
},
],
'require-jsdoc': 2,
semi: 2,
'@typescript-eslint/consistent-type-assertions': [
2,
{
assertionStyle: 'as',
},
],
'@typescript-eslint/consistent-type-definitions': ['error', 'interface'],
'@typescript-eslint/consistent-type-imports': [
2,
{
prefer: 'type-imports',
disallowTypeAnnotations: false,
},
],
'@typescript-eslint/explicit-function-return-type': 2,
'@typescript-eslint/explicit-module-boundary-types': 2,
'@typescript-eslint/naming-convention': [
2,
{
selector: 'interface',
format: ['PascalCase'],
custom: {
regex: '^I[A-Z]',
match: true,
},
},
{
selector: 'enum',
format: ['PascalCase'],
custom: {
regex: '^E[A-Z]',
match: true,
},
},
{
selector: 'variable',
format: ['camelCase', 'PascalCase'],
},
{
selector: 'classProperty',
modifiers: ['private'],
format: ['camelCase'],
leadingUnderscore: 'require',
},
{
selector: 'typeLike',
format: ['PascalCase'],
},
{
selector: 'variable',
format: ['camelCase', 'PascalCase'],
},
],
'@typescript-eslint/no-dynamic-delete': 0,
'@typescript-eslint/no-empty-interface': 2,
'@typescript-eslint/no-empty-function': 0,
'@typescript-eslint/no-explicit-any': 2,
'@typescript-eslint/no-extraneous-class': 0,
'@typescript-eslint/no-non-null-assertion': 0,
'@typescript-eslint/no-shadow': 0,
'@typescript-eslint/no-unnecessary-condition': 0,
'@typescript-eslint/no-unsafe-member-access': 0,
'@typescript-eslint/no-unused-expressions': 0,
'@typescript-eslint/no-unused-vars': 2,
'@typescript-eslint/no-this-alias': [
2,
{
allowedNames: ['self'],
},
],
'@typescript-eslint/no-var-requires': 0,
'@typescript-eslint/prefer-nullish-coalescing': 2,
'@typescript-eslint/semi': ['error'],
'@typescript-eslint/typedef': 2,
quotes: [
2,
'single',
{
avoidEscape: true,
},
],
},
};