-
Notifications
You must be signed in to change notification settings - Fork 7
/
eslint.config.js
73 lines (70 loc) · 2.67 KB
/
eslint.config.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
import eslint from '@eslint/js';
import tseslint from 'typescript-eslint';
import stylistic from '@stylistic/eslint-plugin';
export default tseslint.config({
extends: [
eslint.configs.recommended,
...tseslint.configs.strictTypeChecked,
...tseslint.configs.stylisticTypeChecked,
...tseslint.configs.recommendedTypeChecked,
stylistic.configs.customize({
quotes: 'single',
indent: 4,
semi: true,
}),
{
languageOptions: {
parserOptions: {
project: true,
tsconfigRootDir: import.meta.dirname,
},
},
},
],
rules: {
'eqeqeq': 'error',
'no-await-in-loop': 'warn',
'no-implicit-coercion': 'warn',
'no-param-reassign': 'error',
'no-undefined': 'warn',
'no-unneeded-ternary': 'warn',
'no-useless-return': 'warn',
'no-var': 'error',
'prefer-arrow-callback': 'warn',
'prefer-const': 'warn',
'@typescript-eslint/no-confusing-void-expression': ['error', { ignoreArrowShorthand: true }],
'@typescript-eslint/explicit-function-return-type': 'warn',
'@typescript-eslint/method-signature-style': 'warn',
'@typescript-eslint/no-unused-expressions': ['error', { allowTernary: true }],
'@typescript-eslint/prefer-readonly': 'warn',
'@typescript-eslint/restrict-template-expressions': ['error', { allowNumber: true }],
'@typescript-eslint/prefer-promise-reject-errors': 'off',
'@typescript-eslint/no-extraneous-class': 'off',
'@typescript-eslint/non-nullable-type-assertion-style': 'off',
'@typescript-eslint/prefer-nullish-coalescing': ['error', {
ignorePrimitives: {
boolean: true,
string: true
}
}],
'@typescript-eslint/no-misused-promises': ['error', { checksVoidReturn: false }],
'@typescript-eslint/no-unnecessary-type-parameters': 'off',
'@stylistic/arrow-parens': ['warn', 'as-needed'],
'@stylistic/quote-props': ['warn', 'as-needed'],
'@stylistic/brace-style': ['error', '1tbs'],
'@stylistic/comma-dangle': 'off',
'@stylistic/indent-binary-ops': 'off',
'@stylistic/space-before-function-paren': 'off',
'@stylistic/type-annotation-spacing': [
'warn',
{
'before': true,
'after': true,
'overrides': {
'colon': { 'before': false, 'after': true }
}
}
],
'@stylistic/array-bracket-spacing': 'off'
}
});