This repository has been archived by the owner on Mar 14, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
/
.eslintrc.js
106 lines (106 loc) · 3.06 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
module.exports = {
parser: '@typescript-eslint/parser',
parserOptions: {
ecmaVersion: 2020,
sourceType: 'module',
project: 'tsconfig.json',
},
reportUnusedDisableDirectives: true,
plugins: ['@typescript-eslint', 'import'],
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
'plugin:@typescript-eslint/recommended-requiring-type-checking',
'plugin:import/errors',
'plugin:import/warnings',
'plugin:import/typescript',
'plugin:prettier/recommended',
'prettier',
],
rules: {
'@typescript-eslint/consistent-type-imports': 'error',
'@typescript-eslint/explicit-module-boundary-types': 'off',
'@typescript-eslint/explicit-member-accessibility': [
'error',
{
accessibility: 'explicit',
},
],
'@typescript-eslint/interface-name-prefix': 'off',
'@typescript-eslint/no-empty-interface': 'off',
'@typescript-eslint/no-non-null-assertion': 'off',
'@typescript-eslint/no-unnecessary-type-assertion': 'error',
'@typescript-eslint/no-unused-vars': [
'error',
{ args: 'after-used', argsIgnorePattern: '^_' },
],
'@typescript-eslint/prefer-nullish-coalescing': 'error',
'@typescript-eslint/prefer-optional-chain': 'error',
// '@typescript-eslint/prefer-readonly': 'error',
'@typescript-eslint/require-await': 'warn',
'@typescript-eslint/strict-boolean-expressions': [
'error',
{
allowNullableBoolean: true,
allowNullableObject: true,
allowNullableString: true,
allowNullableNumber: true,
},
],
'@typescript-eslint/switch-exhaustiveness-check': 'error',
'import/order': [
'error',
{
groups: [
'index',
'sibling',
'parent',
'internal',
'external',
'builtin',
],
'newlines-between': 'always',
},
],
'import/no-cycle': ['error'],
'max-classes-per-file': 'off',
'prefer-template': 'error',
eqeqeq: ['error', 'always'],
},
settings: {
'import/resolver': {
typescript: {},
},
'import/external-module-folders': ['node_modules', 'typings'],
},
overrides: [
{
files: ['*.spec.ts'],
rules: {
'@typescript-eslint/consistent-type-imports': 'off',
'@typescript-eslint/no-unsafe-assignment': 'off',
'@typescript-eslint/no-unsafe-call': 'off',
'@typescript-eslint/no-unsafe-member-access': 'off',
'@typescript-eslint/no-unsafe-return': 'off',
'@typescript-eslint/no-var-requires': 'off',
'@typescript-eslint/restrict-template-expressions': 'off',
},
},
{
files: ['*.type.ts'],
rules: {
'@typescript-eslint/no-explicit-any': 'off',
},
},
{
files: ['*.js', '.*.js'],
rules: {
'@typescript-eslint/no-unsafe-assignment': 'off',
'@typescript-eslint/no-unsafe-call': 'off',
'@typescript-eslint/no-unsafe-member-access': 'off',
'@typescript-eslint/no-var-requires': 'off',
'no-undef': 'off',
},
},
],
}