/
.eslintrc.js
85 lines (81 loc) · 2.46 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
module.exports = {
env: {
node: true,
},
plugins: ['@renovate'],
extends: [
'eslint:recommended',
'plugin:import/errors',
'plugin:import/warnings',
'plugin:import/typescript',
'plugin:jest/recommended',
'plugin:jest/style',
// https://github.com/typescript-eslint/typescript-eslint/tree/master/packages/eslint-plugin/src/configs
'plugin:@typescript-eslint/recommended',
'plugin:@typescript-eslint/recommended-requiring-type-checking',
'plugin:promise/recommended',
'prettier',
],
parserOptions: {
ecmaVersion: 9,
tsconfigRootDir: __dirname,
project: './tsconfig.lint.json',
extraFileExtensions: ['.mjs'],
},
rules: {
'import/no-unresolved': 0, // done by typescript
'import/prefer-default-export': 0, // no benefit
'require-await': 'error',
'no-use-before-define': 0,
'no-restricted-syntax': 0,
'no-await-in-loop': 0,
'prefer-destructuring': 'off',
'prefer-template': 'off',
'no-underscore-dangle': 0,
// TODO: fix lint
'@typescript-eslint/camelcase': 'off', // disabled until ??
'@typescript-eslint/no-var-requires': 'off', // disable until all files converted to typescript
'@typescript-eslint/no-use-before-define': 'off', // disable until all files converted to typescript
'@typescript-eslint/explicit-member-accessibility': 0,
'@typescript-eslint/explicit-function-return-type': 0,
'@typescript-eslint/no-explicit-any': 0,
'@typescript-eslint/no-non-null-assertion': 0,
'@typescript-eslint/no-unused-vars': [
'error',
{
vars: 'all',
args: 'none',
ignoreRestSiblings: false,
},
], // disable until proper interfaced api
},
overrides: [
{
// files to check, so no `--ext` is required
files: ['**/*.{js,mjs,cjs,ts}'],
},
{
files: ['**/*.test.ts'],
env: {
jest: true,
},
rules: {
'prefer-destructuring': 0,
'prefer-promise-reject-errors': 0,
'import/no-dynamic-require': 0,
'global-require': 0,
'@typescript-eslint/no-var-requires': 0,
'@typescript-eslint/no-object-literal-type-assertion': 0,
'@typescript-eslint/explicit-function-return-type': 0,
'@typescript-eslint/unbound-method': 0,
'jest/expect-expect': 0, // TODO: fix me
},
},
{
files: ['**/*.mjs'],
rules: {
'@typescript-eslint/explicit-function-return-type': 0,
},
},
],
};