-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathts.js
56 lines (55 loc) · 1.36 KB
/
ts.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
module.exports = {
extends: [
'./react',
'plugin:@typescript-eslint/eslint-recommended',
'plugin:@typescript-eslint/recommended',
],
plugins: [
'@typescript-eslint', // @typescript-eslint/eslint-plugin
],
parser: '@typescript-eslint/parser',
parserOptions: {
ecmaVersion: 12,
sourceType: 'module',
},
settings: {
'import/resolver': {
typescript: {
// always try to resolve types under `<root>@types` directory even it doesn't contain any source code,
// like `@types/unist`
alwaysTryTypes: true,
},
},
},
rules: {
// its fix
'no-unused-vars': 'off',
'@typescript-eslint/no-unused-vars': ['error'],
'no-use-before-define': 'off',
'@typescript-eslint/no-use-before-define': ['error'],
// ts
'@typescript-eslint/ban-ts-comment': 'off',
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/explicit-module-boundary-types': 'off',
'@typescript-eslint/no-var-requires': 'off',
'@typescript-eslint/ban-types': [
'error',
{
types: {
object: {
fixWith: 'Record<string, unknown>',
},
},
extendDefaults: true,
},
],
},
overrides: [
{
files: ['*.js', '*.jsx'],
rules: {
'@typescript-eslint/explicit-module-boundary-types': 'off',
},
},
],
};