-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintrc.cjs
92 lines (92 loc) · 2.76 KB
/
.eslintrc.cjs
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
/* eslint-disable sonarjs/no-duplicate-string */
/* eslint-disable no-undef */
module.exports = {
env: {
browser: true,
es6: true
},
extends: [
'eslint:recommended',
'plugin:react/recommended',
'plugin:react-hooks/recommended',
'plugin:jsx-a11y/recommended',
'plugin:sonarjs/recommended',
'plugin:@typescript-eslint/eslint-recommended',
],
settings: { react: { version: 'detect' } },
parser: '@typescript-eslint/parser',
parserOptions: {
ecmaVersion: 2021,
sourceType: 'module'
},
plugins: [ '@typescript-eslint' ],
rules: {
indent: [ 'error', 2, { SwitchCase: 1 } ],
'@typescript-eslint/indent': [ 'error', 2 ],
'linebreak-style': [ 'error', 'unix' ],
quotes: [ 'error', 'single', { allowTemplateLiterals: true } ],
semi: [ 'error', 'never' ],
'eol-last': [ 'error', 'always' ],
eqeqeq: [ 'error', 'always' ],
'spaced-comment': [ 'error', 'always', { markers: [ '/' ] } ],
'block-spacing': [ 'error', 'always' ],
'no-whitespace-before-property': [ 'error' ],
'no-trailing-spaces': [ 'error' ],
'space-in-parens': [ 'error', 'always', { 'exceptions': [ 'empty' ] } ],
'array-bracket-spacing': [ 'error', 'always' ],
'object-curly-spacing': [ 'error', 'always' ],
'no-unused-vars': [ 'off' ],
'no-multiple-empty-lines': [ 'error', { max: 1 } ],
'@typescript-eslint/no-unused-vars': [ 'error' ],
'brace-style': 'off',
'no-multi-spaces': 'error',
'@typescript-eslint/type-annotation-spacing': [
'error',
{
before: false,
after: true,
overrides: {
arrow: {
before: true,
after: true
}
}
}
],
'@typescript-eslint/brace-style': [ 'error' ],
'@typescript-eslint/explicit-function-return-type': [ 'error' ],
'max-len': [ 'error', { code: 120 } ],
'space-infix-ops': [ 'error' ],
'key-spacing': [ 'error' ],
'comma-spacing': [ 'error' ],
'arrow-spacing': [ 'error' ],
'keyword-spacing': [ 'error' ],
'padding-line-between-statements': [
'error',
{ blankLine: 'always', prev: 'function', next: 'function' },
{
blankLine: 'always',
prev: 'multiline-block-like',
next: 'multiline-block-like'
},
{
blankLine: 'always',
prev: 'multiline-expression',
next: 'multiline-block-like'
},
{
blankLine: 'always',
prev: 'multiline-block-like',
next: 'multiline-expression'
},
{
blankLine: 'always',
prev: 'multiline-expression',
next: 'multiline-expression'
},
{ blankLine: 'always', prev: 'import', next: 'expression' }
],
'react/react-in-jsx-scope': 'off',
'switch-colon-spacing': [ 'error' ],
}
}