-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.eslintrc.js
111 lines (110 loc) · 3.69 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
module.exports = {
env: {
browser: true,
es2021: true,
jest: true,
},
parser: '@typescript-eslint/parser',
plugins: [
'simple-import-sort',
'jsx-a11y',
'promise',
'sonarjs',
'unicorn',
],
parserOptions: {
sourceType: 'module',
ecmaVersion: 'latest',
},
settings: {
react: {
version: 'detect',
},
},
extends: [
'prettier',
'plugin:prettier/recommended',
'plugin:@typescript-eslint/recommended',
'eslint:recommended',
'plugin:promise/recommended',
'plugin:sonarjs/recommended-legacy',
],
overrides: [
{
files: ['*.js', '*.ts', '*'],
rules: {
'simple-import-sort/imports': [
'error',
{
groups: [
['^react', '^@?\\w'],
['^(@|components)(/.*|$)'],
['^\\u0000'],
['^\\.\\.(?!/?$)', '^\\.\\./?$'],
['^\\./(?=.*/)(?!/?$)', '^\\.(?!/?$)', '^\\./?$'],
['^.+\\.?(css)$'],
],
},
],
},
},
],
rules: {
'no-console': 'error',
'promise/catch-or-return': 0,
'promise/always-return': 0,
'@typescript-eslint/consistent-type-definitions': 'error',
'simple-import-sort/imports': 'error',
'simple-import-sort/exports': 'error',
'no-undef': 0,
'no-unused-vars': 0,
'sonarjs/no-collapsible-if': 0,
'sonarjs/no-identical-expressions': 0,
'@typescript-eslint/no-explicit-any': 0,
'@typescript-eslint/ban-ts-comment': 0,
'sonarjs/no-small-switch': 0,
'sonarjs/no-identical-functions': 0,
'@typescript-eslint/naming-convention': [
'error',
{
selector: 'interface',
format: ['PascalCase'],
custom: {
regex: '^I[A-Z]',
match: true,
},
},
],
'lines-between-class-members': ['error', 'always'],
'padding-line-between-statements': [
'warn',
{ blankLine: 'always', prev: '*', next: 'block' },
{ blankLine: 'always', prev: 'block', next: '*' },
{ blankLine: 'always', prev: '*', next: 'block-like' },
{ blankLine: 'always', prev: 'block-like', next: '*' },
{ blankLine: 'always', prev: '*', next: 'return' },
{ blankLine: 'always', prev: 'directive', next: '*' },
{ blankLine: 'always', prev: 'multiline-block-like', next: '*' },
{ blankLine: 'always', prev: 'multiline-const', next: '*' },
{ blankLine: 'always', prev: '*', next: 'multiline-const' },
{ blankLine: 'always', prev: 'import', next: '*' },
{
blankLine: 'any',
prev: ['singleline-const', 'singleline-let'],
next: ['singleline-const', 'singleline-let'],
},
{ blankLine: 'always', prev: ['case', 'default'], next: '*' },
{ blankLine: 'always', prev: '*', next: 'export' },
{
blankLine: 'any',
prev: ['export'],
next: ['export'],
},
{
blankLine: 'any',
prev: ['import'],
next: ['import'],
},
],
},
};