-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy path.eslintrc.js
102 lines (102 loc) · 3.33 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
module.exports = {
env: {
browser: false,
es6: true,
node: true
},
parser: '@typescript-eslint/parser',
parserOptions: {
ecmaVersion: 'node',
sourceType: 'module',
tsconfigRootDir: __dirname,
project: ['./tsconfig.json', 'packages/tsconfig.json', 'examples/tsconfig.json'],
warnOnUnsupportedTypeScriptVersion: false
},
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
'plugin:@typescript-eslint/recommended-requiring-type-checking',
'plugin:prettier/recommended'
],
rules: {
'prettier/prettier': 'warn',
'@typescript-eslint/no-unsafe-declaration-merging': 'off',
'@typescript-eslint/no-redundant-type-constituents': 'off',
'@typescript-eslint/adjacent-overload-signatures': 'error',
'@typescript-eslint/await-thenable': 'error',
'@typescript-eslint/explicit-function-return-type': [
'warn',
{ allowExpressions: true, allowTypedFunctionExpressions: true }
],
'@typescript-eslint/explicit-member-accessibility': 'off',
'@typescript-eslint/interface-name-prefix': 'off',
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-parameter-properties': 'off',
'@typescript-eslint/no-shadow': 'error',
'@typescript-eslint/no-this-alias': 'error',
'@typescript-eslint/no-unused-vars': ['error', { args: 'none' }],
'@typescript-eslint/prefer-function-type': 'error',
'@typescript-eslint/prefer-namespace-keyword': 'error',
'@typescript-eslint/promise-function-async': 'off',
'@typescript-eslint/member-ordering': 'warn',
'@typescript-eslint/require-await': 'off',
'@typescript-eslint/no-var-requires': 'off',
'@typescript-eslint/naming-convention': [
'error',
{
selector: 'typeParameter',
format: ['PascalCase']
}
],
'no-empty': 'off',
'no-irregular-whitespace': 'error',
'no-return-assign': 'error',
'no-return-await': 'error',
'no-throw-literal': 'error',
'no-undef': 'off',
'no-useless-call': 'error',
'no-useless-concat': 'error',
'no-var': 'error',
'prefer-const': 'error',
'prefer-object-spread': 'error',
'lines-between-class-members': ['error', 'always', { exceptAfterSingleLine: true }],
'prefer-template': 'error',
'prefer-arrow-callback': 'warn',
'linebreak-style': ['error', 'unix'],
quotes: ['error', 'single'],
'no-console': 'error'
},
overrides: [
{
files: ['test/**'],
plugins: ['jest'],
extends: [
'plugin:jest/recommended',
'plugin:jest/style',
'plugin:jest-formatting/recommended'
],
rules: {
'@typescript-eslint/unbound-method': 'off',
'jest/unbound-method': 'error',
'jest/expect-expect': ['error', { assertFunctionNames: ['expect', 'request.**.expect'] }]
}
},
{
files: ['examples/**/*.*'],
rules: {
'@typescript-eslint/explicit-function-return-type': 'off',
'no-console': 'off'
}
},
{
files: ['examples/**/*.js'],
rules: {
'@typescript-eslint/no-unsafe-call': 'off',
'@typescript-eslint/no-unsafe-member-access': 'off',
'@typescript-eslint/no-unsafe-return': 'off',
'@typescript-eslint/restrict-template-expressions': 'off',
'@typescript-eslint/no-unsafe-assignment': 'off'
}
}
]
};