-
-
Notifications
You must be signed in to change notification settings - Fork 18
/
.eslintrc.js
159 lines (156 loc) · 4.54 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
require('./esm/register.cjs');
module.exports = {
extends: [
'eslint:recommended',
'plugin:import/typescript',
'plugin:prettier/recommended',
],
parser: '@typescript-eslint/parser',
plugins: [
'babel',
'import',
'lodash',
'prettier',
'promise',
'you-dont-need-lodash-underscore',
'@typescript-eslint',
],
env: {
node: true,
es2020: true,
},
parserOptions: {
ecmaVersion: 2020,
sourceType: 'module',
ecmaFeatures: { jsx: true },
},
'globals': {
'NodeJS': true,
'RequestInit': true
},
rules: {
'prettier/prettier': [
'error',
{
trailingComma: 'all',
tabWidth: 2,
semi: true,
singleQuote: true,
printWidth: 100,
useTabs: false,
bracketSpacing: true,
bracketSameLine: false,
arrowParens: 'always',
endOfLine: 'auto',
},
{
usePrettierrc: true,
},
],
'consistent-return': 2,
curly: 2,
'func-name-matching': 2,
'import/default': 2,
'import/named': 2,
'import/namespace': 2,
'import/no-duplicates': 2,
'import/no-extraneous-dependencies': 2,
'import/no-mutable-exports': 2,
'import/no-named-as-default': 2,
'import/no-named-as-default-member': 2,
'import/no-unresolved': 2,
'import/order': [
2,
{
groups: ['builtin', 'external', 'internal', 'parent', 'sibling', 'index'],
'newlines-between': 'always',
},
],
'lodash/callback-binding': 2,
'lodash/collection-method-value': 2,
'lodash/collection-return': 2,
'lodash/no-double-unwrap': 2,
'lodash/no-extra-args': 2,
'lodash/prefer-compact': 2,
'lodash/prefer-filter': 2,
'lodash/prefer-map': 2,
'lodash/unwrap': 2,
'max-statements-per-line': [2, { max: 1 }],
'no-async-promise-executor': 2,
'no-await-in-loop': 2,
'no-control-regex': 0,
'no-constant-binary-expression': 2,
'no-debugger': 2,
'no-duplicate-imports': 2,
'no-else-return': 2,
'no-global-assign': 2,
'no-lonely-if': 2,
'no-misleading-character-class': 2,
'no-native-reassign': 2,
'no-nested-ternary': 2,
'no-prototype-builtins': 0,
'no-restricted-properties': [
1,
{
object: '_',
property: 'extend',
message: 'consider using [...arr] or { ...obj } instead',
},
],
'no-shadow': [2, { allow: ['err', 'res'] }],
'no-template-curly-in-string': 2,
'no-throw-literal': 2,
'no-undef': 2,
'no-unneeded-ternary': 2,
'no-unsafe-negation': 2,
'no-useless-computed-key': 2,
'no-var': 2,
'no-warning-comments': 1,
'object-shorthand': [2, 'properties'],
'padding-line-between-statements': [
2,
{ blankLine: 'always', prev: '*', next: 'block' },
{ blankLine: 'always', prev: '*', next: 'for' },
{ blankLine: 'always', prev: '*', next: 'if' },
{ blankLine: 'always', prev: '*', next: 'switch' },
{ blankLine: 'always', prev: '*', next: 'try' },
{ blankLine: 'always', prev: '*', next: 'while' },
{ blankLine: 'always', prev: 'block', next: '*' },
{ blankLine: 'always', prev: 'for', next: '*' },
{ blankLine: 'always', prev: 'if', next: '*' },
{ blankLine: 'always', prev: 'switch', next: '*' },
{ blankLine: 'always', prev: 'try', next: '*' },
{ blankLine: 'always', prev: 'while', next: '*' },
],
'prefer-const': 2,
'prefer-destructuring': 2,
'prefer-numeric-literals': 1,
'prefer-object-spread': 2,
'prefer-rest-params': 2,
'prefer-spread': 2,
'prefer-template': 2,
'promise/param-names': 2,
'promise/catch-or-return': 2,
'promise/no-native': 0,
'require-atomic-updates': 0,
'require-yield': 0,
'require-await': 2,
'spaced-comment': [2, 'always', { exceptions: ['/'] }],
strict: [2, 'never'],
'you-dont-need-lodash-underscore/assign': 2,
'you-dont-need-lodash-underscore/concat': 2,
'you-dont-need-lodash-underscore/find': 2,
'you-dont-need-lodash-underscore/find-index': 2,
'you-dont-need-lodash-underscore/includes': 2,
'you-dont-need-lodash-underscore/index-of': 2,
'you-dont-need-lodash-underscore/keys': 2,
'you-dont-need-lodash-underscore/repeat': 2,
'you-dont-need-lodash-underscore/reverse': 2,
'you-dont-need-lodash-underscore/to-lower': 2,
'you-dont-need-lodash-underscore/to-upper': 2,
'you-dont-need-lodash-underscore/trim': 2,
'you-dont-need-lodash-underscore/values': 2,
'no-unused-vars': 'off',
'@typescript-eslint/no-unused-vars': ['error'],
},
};