-
Notifications
You must be signed in to change notification settings - Fork 4
/
.eslintrc.js
131 lines (130 loc) · 4.04 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
const confusingBrowserGlobals = require('confusing-browser-globals');
module.exports = {
ignorePatterns: ['**/dist/**'],
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
'plugin:react/recommended',
'prettier'
],
env: {
browser: true,
es6: true,
node: true
},
parser: '@typescript-eslint/parser',
parserOptions: {
ecmaVersion: 2017,
sourceType: 'module'
},
plugins: [
'@typescript-eslint/eslint-plugin',
'import',
'react-hooks',
'jest',
'@regru/prefer-early-return'
],
settings: {
react: {
version: 'detect'
}
},
globals: {
google: 'readonly'
},
rules: {
'@typescript-eslint/explicit-function-return-type': 'off',
'@typescript-eslint/no-non-null-assertion': 'off',
'@typescript-eslint/no-explicit-any': 'off',
'react/no-children-prop': 'off',
'react/prop-types': 'off',
'react/display-name': 'off',
'@typescript-eslint/no-use-before-define': 'off',
'no-unused-vars': 'off',
'@typescript-eslint/no-unused-vars': [
'error',
{
vars: 'all',
args: 'after-used',
ignoreRestSiblings: true
}
],
'no-empty': [
'error',
{
allowEmptyCatch: true
}
],
'import/order': [
'error',
{
'newlines-between': 'always'
}
],
'react-hooks/rules-of-hooks': 'error',
'react-hooks/exhaustive-deps': 'error',
'react/jsx-boolean-value': 'error',
'react/jsx-first-prop-new-line': 'error',
'react/jsx-indent-props': ['error', 4],
'react/jsx-max-props-per-line': 'error',
'react/self-closing-comp': 'error',
'react/jsx-closing-bracket-location': 'error',
'react/jsx-wrap-multilines': [
'error',
{
declaration: 'parens-new-line',
assignment: 'parens-new-line',
return: 'parens-new-line',
arrow: 'parens-new-line',
condition: 'parens-new-line',
logical: 'parens-new-line',
prop: 'ignore'
}
],
'react/jsx-one-expression-per-line': ['error', {allow: 'single-child'}],
'eol-last': 'error',
'no-nested-ternary': 'error',
'@regru/prefer-early-return/prefer-early-return': 'error',
'no-multiple-empty-lines': [
'error',
{
max: 1
}
],
'no-console': 'error',
'lines-between-class-members': ['error', 'always'],
'no-restricted-globals': ['error', 'isFinite', 'isNaN'].concat(
confusingBrowserGlobals
),
'id-match': ['error', '^[a-zA-Z_$][a-zA-Z0-9_$]*$'], // https://regex101.com/r/LoObQT/1
'no-else-return': ['error', {allowElseIf: false}],
'padding-line-between-statements': [
'error',
{blankLine: 'always', prev: '*', next: 'if'}
],
'@typescript-eslint/explicit-module-boundary-types': 'off',
'@typescript-eslint/no-var-requires': 'off'
},
overrides: [
{
files: ['*.test.ts?(x)', '**/__jest__/setup.ts'],
extends: [
'plugin:jest/recommended',
'plugin:jest-dom/recommended',
'plugin:testing-library/react'
],
env: {
'jest/globals': true
},
rules: {
'jest/no-disabled-tests': 'off',
'jest/expect-expect': 'off',
'jest/no-standalone-expect': 'off',
'jest/valid-expect-in-promise': 'off',
'jest/no-conditional-expect': 'off',
'jest/valid-title': 'off',
'testing-library/render-result-naming-convention': 'off'
}
}
]
};