-
Notifications
You must be signed in to change notification settings - Fork 49
/
.eslintrc.cjs
164 lines (159 loc) · 4.4 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
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
module.exports = {
root: true,
env: { browser: true, es2020: true },
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
'plugin:@typescript-eslint/recommended-type-checked',
'plugin:@typescript-eslint/stylistic-type-checked'
],
parser: '@typescript-eslint/parser',
plugins: ['@typescript-eslint', 'import'],
parserOptions: {
// tsconfigRootDir: __dirname,
sourceType: 'module',
ecmaVersion: 'latest',
ecmaFeatures: {
// experimentalObjectRestSpread: true,
modules: true,
legacyDecorators: true
},
project: ['./tsconfig.json'],
},
rules: {
// 'import/extensions': [
// 'error',
// "ignorePackages",
// {
// "js": "always",
// "ts": "never"
// }
// ],
'import/no-unresolved': ['off'],
'class-methods-use-this': ['off'],
'radix': ['off'],
'import/prefer-default-export': ['off'],
'implicit-arrow-linebreak': ['off'],
'no-trailing-spaces': [
'error', {
'skipBlankLines': true,
'ignoreComments': true,
},
],
'max-len': [
'error', {
'code': 120,
},
],
'prefer-rest-params': ['off'],
'import/no-extraneous-dependencies': [
'error', {
'devDependencies': ['**/__tests__/*.ts', '**/__mocks__/*.ts'],
},
],
'one-var': ['off'],
// false positive https://github.com/typescript-eslint/typescript-eslint/issues/2483
'no-shadow': 'off',
'object-curly-newline': ["error", {
"ObjectExpression": { "multiline": true, "minProperties": 8 },
"ObjectPattern": { "multiline": true, "minProperties": 8 },
"ImportDeclaration": {"multiline": true, "minProperties": 8 },
"ExportDeclaration": { "multiline": true, "minProperties": 8 }
}],
"@typescript-eslint/explicit-function-return-type": 'error',
'@typescript-eslint/triple-slash-reference': 'off',
'@typescript-eslint/no-shadow': 'error',
'@typescript-eslint/no-unsafe-argument': 'off',
'@typescript-eslint/no-unsafe-assignment': 'off',
'@typescript-eslint/no-unsafe-member-access': 'off',
'@typescript-eslint/no-unsafe-return': 'off',
'@typescript-eslint/no-unsafe-call': 'off',
'@typescript-eslint/prefer-nullish-coalescing': 'off',
'@typescript-eslint/consistent-type-definitions': 'off',
'@typescript-eslint/no-unused-expressions': [
'error',
{
'allowShortCircuit': true,
'allowTernary': true,
},
],
'@typescript-eslint/no-use-before-define': ['off'],
'@typescript-eslint/no-unused-vars': [
'error',
{'argsIgnorePattern': '^_'},
],
'@typescript-eslint/explicit-module-boundary-types': [
'off', {
allowArgumentsExplicitlyTypedAsAny: true,
},
],
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/ban-ts-comment': [
'off',
{'ts-expect-error': 'allow-with-description'},
],
'@typescript-eslint/no-empty-function': [
'error',
{
'allow': [
'methods',
'asyncMethods',
],
},
],
'lines-between-class-members': 'off',
'@typescript-eslint/lines-between-class-members': 'off',
'curly': ['error', 'multi-line', 'consistent'],
'no-unused-vars': 'off',
'jest/no-test-prefixes': 'off',
'jest/no-focused-tests': 'off',
'comma-dangle': ['error', 'only-multiline'],
'linebreak-style': ['error', 'unix'],
'quotes': ['error', 'single'],
'semi': ['error', 'always'],
'eqeqeq': ['error', 'always'],
'complexity': [
'error', {
max: 8,
},
],
'block-scoped-var': 'error',
'no-else-return': [
'error', {
allowElseIf: true,
},
],
'no-debugger': 'off',
'no-eval': 'error',
'no-lone-blocks': 'error',
'no-multi-spaces': 'error',
'no-useless-return': 'error',
'no-var': 'error',
'no-console': [
// 'error', {
// allow: ['warn', 'error'],
// },
'off',
],
'no-throw-literal': 'error',
'newline-per-chained-call': [
'error', {
ignoreChainWithDepth: 4,
},
],
'no-extra-boolean-cast': [
'error', {
enforceForLogicalOperands: true,
},
],
'no-fallthrough': 'error',
'no-use-before-define': 'off',
'no-case-declarations': 'off',
},
ignorePatterns: [
'node_modules',
'web/**/*.d.ts',
'web/**/*.js'
],
globals: {},
}