-
-
Notifications
You must be signed in to change notification settings - Fork 11
/
.eslintrc.js
72 lines (67 loc) · 1.95 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
module.exports = {
root: true,
parser: '@typescript-eslint/parser',
parserOptions: {
ecmaVersion: 2017,
},
plugins: ['node', 'prettier'],
extends: ['eslint:recommended', 'plugin:node/recommended', 'plugin:prettier/recommended'],
env: {
node: true,
},
ignorePatterns: ['src/**/*.js', '__tests__/**/*.js'],
rules: {},
overrides: [
// test files
{
files: ['__tests__/**/*.js'],
env: {
jest: true,
},
rules: {
'node/no-unpublished-require': 'off',
},
},
{
parserOptions: {
ecmaVersion: 2020,
},
files: ['**/*.ts'],
plugins: ['@typescript-eslint'],
extends: [
'plugin:@typescript-eslint/eslint-recommended',
'plugin:@typescript-eslint/recommended',
],
rules: {
'prefer-const': 'off',
'node/no-unsupported-features/es-syntax': [
'error',
{
ignores: ['modules'],
},
],
'node/no-missing-import': 'off',
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/ban-ts-comment': 'off',
'@typescript-eslint/explicit-function-return-type': 'error',
'@typescript-eslint/no-unused-vars': ['error', { argsIgnorePattern: '^_' }],
'@typescript-eslint/explicit-module-boundary-types': ['off'],
// We should try to remove this eventually
'@typescript-eslint/explicit-function-return-type': 'off',
'@typescript-eslint/ban-types': [
'error',
{
types: {
// we currently use `object` as "valid WeakMap key" in a lot of APIs
object: false,
},
},
],
// disabling this one because of DEBUG APIs, if we ever find a better
// way to suport those we should re-enable it
'@typescript-eslint/no-non-null-assertion': 'off',
'@typescript-eslint/no-use-before-define': 'off',
},
},
],
};