-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintrc.js
118 lines (118 loc) · 3.13 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
module.exports = {
env: {
browser: true,
es2021: true,
},
extends: ['airbnb-base'],
parserOptions: {
ecmaVersion: 'latest',
sourceType: 'module',
},
rules: {
'array-bracket-spacing': ['error', 'never'],
'arrow-body-style': ['error', 'as-needed'],
'arrow-parens': ['error', 'always'],
'brace-style': 'error',
'comma-dangle': [
'error',
{
arrays: 'always-multiline',
exports: 'always-multiline',
functions: 'only-multiline',
imports: 'always-multiline',
objects: 'always-multiline',
},
],
'comma-spacing': ['error', { after: true, before: false }],
curly: 'error',
'eol-last': ['error', 'always'],
eqeqeq: ['error', 'always'],
'func-names': 'error',
'import/no-extraneous-dependencies': 'error',
'import/no-unresolved': 'error',
'import/order': [
'error',
{
alphabetize: {
order: 'asc',
},
groups: ['builtin', 'external', 'internal', 'parent', 'sibling', 'index'],
'newlines-between': 'always-and-inside-groups',
},
],
indent: ['error', 2, { SwitchCase: 1 }],
'jsx-quotes': ['error', 'prefer-double'],
'key-spacing': ['error', { mode: 'strict' }],
'max-depth': ['error', 3],
'max-len': [
'error',
{
code: 125,
ignoreComments: true,
ignoreStrings: true,
ignoreTemplateLiterals: true,
},
],
'max-params': ['error', 3],
'multiline-comment-style': 'off',
'no-alert': 'error',
'no-console': 'warn',
'no-duplicate-imports': 'error',
'no-empty-function': 'warn',
'no-extra-boolean-cast': 'warn',
'no-extra-semi': 'warn',
'no-magic-numbers': [
'error',
{
ignore: [-1, 0, 1, 2, 30, 60, 100, 1000],
ignoreArrayIndexes: true,
},
],
'no-multi-spaces': 'warn',
'no-multiple-empty-lines': ['error', { max: 1, maxEOF: 0 }],
'no-plusplus': 'warn',
'no-trailing-spaces': 'warn',
'no-unreachable': 'error',
'no-unused-expressions': 'warn',
'no-unused-vars': ['warn', { args: 'none' }],
'no-use-before-define': 'off',
'no-var': 'error',
'padding-line-between-statements': [
'error',
{ blankLine: 'always', next: 'return', prev: '*' },
],
'prefer-arrow-callback': 'warn',
'prefer-const': 'error',
'prettier/prettier': ['error', prettierOptions],
quotes: ['error', 'single', { avoidEscape: true }],
semi: ['error', 'always'],
'semi-spacing': ['error', { after: true, before: false }],
'sonarjs/cognitive-complexity': ['error', 30],
'sort-keys': [
'error',
'asc',
{
caseSensitive: false,
minKeys: 2,
natural: false,
},
],
'space-before-blocks': 'error',
'space-before-function-paren': [
'error',
{ anonymous: 'always', asyncArrow: 'always', named: 'never' },
],
'space-in-parens': ['error', 'never'],
},
settings: {
'import/resolver': {
node: {
extensions: ['.js', '.jsx', '.ts', '.tsx'],
},
typescript: {},
},
react: {
version: '17.0.2',
},
},
};