-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintrc.cjs
139 lines (129 loc) · 3.92 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
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
module.exports = {
root: true,
env: {
browser: true,
node : true,
es2021 : true,
},
extends: [
'plugin:react/recommended',
'airbnb',
],
parser : '@typescript-eslint/parser',
parserOptions: {
ecmaFeatures: {
jsx: true,
},
ecmaVersion: 'latest',
sourceType : 'module',
},
plugins: [
'react',
'@typescript-eslint',
'jsdoc',
],
rules: {
'max-len': [
'error',
{
code: 256,
},
],
indent : ['error', 4],
'no-console': process.env.NODE_ENV === 'production' ? [
'error',
{
allow: [
'warn', 'error',
],
},
] : 'off',
'no-debugger' : process.env.NODE_ENV === 'production' ? 'error' : 'off',
'padded-blocks' : ['error', 'never'],
'linebreak-style' : ['error', process.platform === 'win32' ? 'windows' : 'unix'],
'lines-between-class-members': [
'error',
'always',
{
exceptAfterSingleLine: true,
},
],
'class-methods-use-this': 'off',
'no-trailing-spaces' : [
'error',
{
skipBlankLines: true,
ignoreComments: true,
},
],
'key-spacing': [
'error',
{
align: 'colon',
},
],
'arrow-parens' : ['error', 'always'],
'no-underscore-dangle' : 'off',
'space-in-parens' : 'off',
'no-prototype-builtins' : 'off',
'import/no-unresolved' : 'off',
'import/extensions' : 'off',
'no-multiple-empty-lines': 'off',
'no-unneeded-ternary' : 'error',
'brace-style' : [
'error',
'1tbs',
],
curly : ['error', 'all'],
'no-else-return' : 'error',
'no-lonely-if' : 'error',
'import/no-named-as-default' : 'off',
'import/no-extraneous-dependencies': 'off',
'import/prefer-default-export' : 'off',
'no-undef': 'off',
// React
'react/prop-types' : 0,
'react/jsx-indent' : ['error', 4],
'react/jsx-indent-props' : ['error', 4],
'react/function-component-definition': ['error', { namedComponents: 'arrow-function' }],
'react/jsx-filename-extension' : ['error', { extensions: ['.js', '.jsx', '.ts', '.tsx'] }],
'react/jsx-curly-spacing' : [2, {
when : 'always',
spacing: {
objectLiterals: 'never',
},
}],
'react/button-has-type': 0,
// JSDoc
'require-jsdoc': [
'warn',
{
require: {
FunctionDeclaration : true,
MethodDefinition : true,
ClassDeclaration : true,
ArrowFunctionExpression: true,
FunctionExpression : true,
},
},
],
'jsdoc/require-returns-description': 0,
'jsdoc/require-param-description' : 0,
'jsdoc/check-indentation' : 1,
'jsdoc/check-line-alignment' : 1,
'jsdoc/check-syntax' : 1,
'jsdoc/match-description' : 0,
'jsdoc/no-multi-asterisks' : [
'warn',
{
preventAtMiddleLines: false,
},
],
'jsdoc/check-tag-names': [
'error',
{
definedTags: ['values'],
},
],
},
};