-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslint.ronasit.js
219 lines (219 loc) · 6.28 KB
/
.eslint.ronasit.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
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
module.exports = {
root: true,
env: {
node: true,
},
parser: '@typescript-eslint/parser',
parserOptions: {
ecmaVersion: 6,
project: 'tsconfig.(base|lib).json',
ecmaFeatures: {
jsx: true,
},
},
settings: {
react: {
version: 'detect',
},
'import/parsers': {
'@typescript-eslint/parser': ['.ts', '.tsx'],
},
'import/resolver': {
typescript: {
alwaysTryTypes: true,
},
node: {
extensions: ['.js', '.jsx', '.ts', '.tsx'],
},
},
},
plugins: [
'@typescript-eslint',
'unused-imports',
'react',
'react-hooks',
'@stylistic',
'import',
],
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/eslint-recommended',
'plugin:@typescript-eslint/recommended',
'plugin:react/recommended',
'prettier',
],
rules: {
'@stylistic/indent': ['warn', 2, { SwitchCase: 1 }],
'@stylistic/quotes': ['warn', 'single', { allowTemplateLiterals: true }],
'react/react-in-jsx-scope': 'off',
'@stylistic/arrow-parens': ['warn', 'always'],
'@stylistic/comma-dangle': ['warn', 'never'],
'no-var': 'warn',
'no-dupe-class-members': 'off',
'import/prefer-default-export': 'off',
'@stylistic/implicit-arrow-linebreak': ['warn', 'beside'],
'@stylistic/newline-per-chained-call': ['warn', { ignoreChainWithDepth: 2 }],
'@stylistic/function-call-argument-newline': ['warn', 'consistent'],
'@stylistic/function-paren-newline': ['warn', 'consistent'],
'@stylistic/array-element-newline': ['warn', 'consistent'],
'@stylistic/array-bracket-newline': ['warn', { multiline: true }],
'@stylistic/padding-line-between-statements': [
'warn',
{ blankLine: 'always', prev: '*', next: 'return' },
{ blankLine: 'always', prev: '*', next: 'multiline-block-like' },
],
'@typescript-eslint/no-use-before-define': ['warn', { variables: false }],
'@stylistic/lines-between-class-members': [
'warn',
'always',
{ exceptAfterSingleLine: true },
],
'@typescript-eslint/no-inferrable-types': [
'warn',
{ ignoreParameters: true },
],
'@typescript-eslint/explicit-module-boundary-types': [
'warn',
{ allowArgumentsExplicitlyTypedAsAny: true },
],
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/explicit-member-accessibility': [
'warn',
{ accessibility: 'explicit', overrides: { constructors: 'no-public' } },
],
'@typescript-eslint/explicit-function-return-type': [
'warn',
{ allowExpressions: true },
],
'@typescript-eslint/no-require-imports': 'off',
'@typescript-eslint/no-unused-vars': 'off',
'@typescript-eslint/array-type': [
'warn',
{ default: 'generic', readonly: 'generic' },
],
'@typescript-eslint/member-ordering': [
'warn',
{
default: [
'public-static-field',
'protected-static-field',
'private-static-field',
'public-instance-field',
'protected-instance-field',
'private-instance-field',
'public-static-accessor',
'protected-static-accessor',
'private-static-accessor',
'public-instance-accessor',
'protected-instance-accessor',
'private-instance-accessor',
'public-constructor',
'protected-constructor',
'private-constructor',
'public-static-method',
'public-instance-method',
'protected-static-method',
'protected-instance-method',
'private-static-method',
'private-instance-method',
],
},
],
'@typescript-eslint/naming-convention': [
'warn',
{
selector: 'typeLike',
format: ['PascalCase'],
},
{
selector: ['parameter'],
format: ['camelCase', 'PascalCase'],
leadingUnderscore: 'allow',
},
{
selector: ['classProperty'],
format: ['camelCase', 'snake_case'],
leadingUnderscore: 'allow',
},
{
selector: ['method', 'accessor'],
format: ['camelCase'],
},
{
selector: ['function', 'typeProperty'],
format: ['camelCase', 'PascalCase'],
},
{
selector: 'variable',
format: ['camelCase', 'PascalCase', 'UPPER_CASE'],
},
{
selector: 'enumMember',
format: ['UPPER_CASE'],
},
],
'unused-imports/no-unused-imports': 'warn',
'unused-imports/no-unused-vars': [
'warn',
{
vars: 'all',
varsIgnorePattern: '^_',
argsIgnorePattern: '^_',
ignoreRestSiblings: true,
},
],
'@stylistic/jsx-quotes': ['warn', 'prefer-single'],
'react/jsx-boolean-value': 'off',
'@stylistic/jsx-self-closing-comp': ['warn', { component: true, html: true }],
'@stylistic/jsx-max-props-per-line': [1, { maximum: { single: 2, multi: 1 } }],
'@stylistic/jsx-first-prop-new-line': ['warn', 'multiline'],
'react/prop-types': 'off',
'react/jsx-fragments': ['warn', 'element'],
'import/newline-after-import': 'warn',
'import/no-unresolved': 'error',
'import/no-cycle': 'error',
'import/order': [
'warn',
{
groups: [
'builtin',
'external',
'internal',
'parent',
'sibling',
'index',
'object',
'type',
],
alphabetize: { order: 'asc' },
},
],
'import/no-duplicates': 'warn',
'react-hooks/exhaustive-deps': 'off',
},
overrides: [
{
files: ['*.js'],
rules: {
'@typescript-eslint/explicit-member-accessibility': 'off',
'@typescript-eslint/explicit-function-return-type': 'off',
},
},
{
files: ['*actions.ts'],
rules: {
'@stylistic/function-call-argument-newline': ['warn', 'always'],
'@stylistic/function-paren-newline': ['warn', { minItems: 1 }],
},
},
{
files: ['*selectors.ts'],
rules: {
'@typescript-eslint/explicit-module-boundary-types': 'off',
'@typescript-eslint/explicit-function-return-type': 'off',
'@stylistic/function-call-argument-newline': ['warn', 'always'],
'@stylistic/function-paren-newline': ['warn', 'multiline-arguments'],
},
},
],
};