-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.eslintrc.js
123 lines (123 loc) · 3.68 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
module.exports = {
env: {
es2020: true,
node: true,
},
extends: [
'airbnb-base',
'airbnb-typescript/base',
'plugin:@typescript-eslint/recommended',
'plugin:import/recommended',
'plugin:import/typescript',
],
parser: '@typescript-eslint/parser',
parserOptions: {
project: './tsconfig.json',
},
plugins: [
'@typescript-eslint',
'node',
'no-loops',
'unused-imports',
],
root: true,
rules: {
'@typescript-eslint/array-type': ['error', {
default: 'generic',
}],
'@typescript-eslint/brace-style': 'error',
'@typescript-eslint/consistent-type-definitions': ['error', 'type'],
'@typescript-eslint/explicit-module-boundary-types': 'error',
'@typescript-eslint/lines-between-class-members': 'off',
'@typescript-eslint/member-delimiter-style': ['error', {
multiline: {
delimiter: 'comma',
requireLast: true,
},
singleline: {
delimiter: 'comma',
requireLast: false,
},
}],
'@typescript-eslint/no-floating-promises': 'error',
'@typescript-eslint/no-misused-promises': ['error', {
checksVoidReturn: false,
}],
'@typescript-eslint/no-unsafe-return': 'error',
'@typescript-eslint/no-unused-vars': 'error',
'@typescript-eslint/prefer-nullish-coalescing': 'error',
'@typescript-eslint/promise-function-async': 'error',
'@typescript-eslint/restrict-template-expressions': 'error',
'@typescript-eslint/semi': ['error', 'never'],
'@typescript-eslint/switch-exhaustiveness-check': 'error',
'@typescript-eslint/type-annotation-spacing': 'error',
'consistent-return': 'off',
curly: ['error', 'multi-or-nest'],
'default-case': 'off',
'function-paren-newline': ['error', 'consistent'],
'import/namespace': 'off',
'import/no-cycle': 'off',
'import/no-relative-packages': 'off',
'import/prefer-default-export': 'off',
'lines-between-class-members': 'off',
'max-len': ['error', 120, 2, {
ignoreComments: false,
ignoreRegExpLiterals: true,
ignoreStrings: true,
ignoreTemplateLiterals: true,
ignoreUrls: true,
}],
'no-await-in-loop': 'off',
'no-loops/no-loops': 2,
'no-restricted-syntax': ['error', ...[
'ForInStatement',
'LabeledStatement',
'WithStatement',
]],
'no-underscore-dangle': 'off',
'no-unreachable': 'error',
'no-void': ['error', {
allowAsStatement: true,
}],
'node/prefer-global/buffer': ['error', 'never'],
'node/prefer-global/text-decoder': ['error', 'never'],
'node/prefer-global/text-encoder': ['error', 'never'],
'node/prefer-global/url': ['error', 'never'],
'node/prefer-global/url-search-params': ['error', 'never'],
'nonblock-statement-body-position': ['error', 'below'],
'prefer-destructuring': 'off',
semi: ['error', 'never'],
'unused-imports/no-unused-imports-ts': 'error',
'import/no-extraneous-dependencies': ['error', { devDependencies: ['feature-test/**/*.ts', 'test/**/*.ts'] }],
},
overrides: [
{
files: ['**/*.test.ts'],
extends: [
'plugin:jest/all',
'plugin:jest-formatting/strict',
],
plugins: [
'jest',
'jest-formatting',
],
rules: {
'jest/no-conditional-in-test': 'off',
'jest/no-disabled-tests': 'off',
'jest/no-hooks': 'off',
'jest/prefer-expect-assertions': 'off',
'jest/prefer-importing-jest-globals': 'off',
'jest/prefer-to-be': 'error',
'jest/prefer-expect-resolves': 'off',
'jest/unbound-method': 'off',
},
},
],
settings: {
'import/resolver': {
typescript: {
alwaysTryTypes: true,
},
},
},
};