-
Notifications
You must be signed in to change notification settings - Fork 8
/
.eslintrc.js
166 lines (164 loc) · 5.52 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
module.exports = {
env: {
browser: true,
node: true,
es2020: true,
es6: true,
commonjs: true,
jest: true,
},
parser: '@babel/eslint-parser',
parserOptions: {
ecmaVersion: 8,
sourceType: 'module',
allowImportExportEverywhere: true,
requireConfigFile: false,
},
globals: {
console: false,
Uint8Array: false,
},
extends: [
'prettier',
'plugin:import/errors',
'plugin:import/warnings',
'plugin:sonarjs/recommended',
'plugin:promise/recommended',
'next/core-web-vitals',
],
plugins: [
'optimize-regex',
'sonarjs',
'no-loops',
'no-use-extend-native',
'promise',
'@babel',
'eslint-plugin-react',
],
rules: {
'valid-jsdoc': 'off',
semi: ['error', 'always', { omitLastInOneLineBlock: true }],
'semi-spacing': ['error', { before: false, after: true }],
'wrap-iife': ['error', 'inside'],
'no-use-before-define': ['error', 'nofunc'],
'no-caller': 'error',
'no-cond-assign': ['error', 'except-parens'],
'no-constant-condition': 'error',
'no-debugger': 'error',
'no-dupe-args': 'error',
'no-dupe-keys': 'error',
'no-duplicate-case': 'error',
'no-empty': ['error', { allowEmptyCatch: true }],
'no-extra-boolean-cast': 'error',
'no-extra-semi': 'error',
'no-func-assign': 'error',
'no-sparse-arrays': 'error',
'no-undef': 'error',
'no-unexpected-multiline': 'error',
'lines-around-comment': [
'error',
{
beforeLineComment: true,
allowObjectStart: true,
allowBlockStart: true,
beforeBlockComment: true,
},
],
'no-unreachable': 'error',
strict: 'off',
'max-params': ['error', 5],
'max-depth': ['error', 4],
'no-eq-null': 'off',
'no-unused-expressions': 'off',
'dot-notation': 'off',
'use-isnan': 'error',
'block-scoped-var': 'error',
complexity: ['error', { max: 30 }],
curly: ['error', 'multi-line'],
eqeqeq: ['error', 'always', { null: 'ignore' }],
'no-extra-bind': 'error',
'no-implicit-coercion': 'error',
'no-return-assign': 'off',
'no-sequences': 'error',
yoda: 'error',
'no-restricted-globals': ['error', 'fdescribe', 'fit'],
'array-bracket-spacing': ['error', 'never'],
'brace-style': ['error', '1tbs', { allowSingleLine: true }],
camelcase: ['warn', { properties: 'never' }],
'comma-spacing': ['error', { before: false, after: true }],
'eol-last': 'error',
'func-call-spacing': 'error',
'keyword-spacing': ['error', { before: true, after: true }],
'max-len': [
'error',
{
code: 120,
ignoreUrls: true,
ignoreRegExpLiterals: true,
ignoreTemplateLiterals: true,
ignoreStrings: true,
ignoreComments: true,
ignorePattern: 'require',
},
],
'no-lonely-if': 'error',
'no-mixed-spaces-and-tabs': 'error',
'no-multi-spaces': 'error',
'no-multiple-empty-lines': ['error', { max: 1, maxBOF: 0, maxEOF: 0 }],
'no-trailing-spaces': 'error',
'no-unneeded-ternary': 'error',
'object-curly-spacing': ['error', 'always'],
'one-var-declaration-per-line': ['error', 'initializations'],
'operator-linebreak': ['error', 'after'],
'padded-blocks': ['error', 'never'],
'quote-props': ['error', 'as-needed', { numbers: true }],
quotes: ['error', 'single', { avoidEscape: true }],
'space-before-blocks': ['error', 'always'],
'space-in-parens': 'error',
'no-console': ['error', { allow: ['assert', 'error', 'warn'] }],
'key-spacing': [
'error',
{ beforeColon: false, afterColon: true, mode: 'strict' },
],
'space-infix-ops': 'error',
'padding-line-between-statements': [
'error',
{ blankLine: 'always', prev: '*', next: 'return' },
{ blankLine: 'always', prev: ['const', 'let', 'var'], next: '*' },
{
blankLine: 'any',
prev: ['const', 'let', 'var'],
next: ['const', 'let', 'var'],
},
{ blankLine: 'always', prev: 'directive', next: '*' },
{ blankLine: 'any', prev: 'directive', next: 'directive' },
{ blankLine: 'always', prev: ['case', 'default'], next: '*' },
],
'space-before-function-paren': [
'error',
{
anonymous: 'never',
named: 'never',
asyncArrow: 'always',
},
],
'template-curly-spacing': 'off',
indent: [
'error',
4,
{
SwitchCase: 1,
ignoredNodes: ['TemplateLiteral'],
},
],
'no-var': 'error',
'no-unused-vars': 'off',
'comma-dangle': ['error', 'always-multiline'],
'arrow-parens': ['error', 'as-needed'],
'prefer-const': 'error',
'jsx-quotes': ['error', 'prefer-double'],
'react/jsx-uses-react': 'error',
'react/jsx-uses-vars': 'error',
},
ignorePatterns: ['node_modules/*', 'build/*'],
};