-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintrc.js
82 lines (82 loc) · 1.99 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
module.exports = {
env: {
node: true,
},
extends: [
'plugin:@typescript-eslint/recommended',
'plugin:prettier/recommended',
],
plugins: ['import'],
parserOptions: {
project: './tsconfig.json',
},
rules: {
'prettier/prettier': 'error',
'import/no-cycle': 'error',
'import/no-unresolved': 'error',
'import/order': [
'error',
{
groups: [
'builtin',
'internal',
'external',
'parent',
'sibling',
'index',
],
},
],
'@typescript-eslint/no-floating-promises': 'error',
'@typescript-eslint/no-var-requires': 'warn',
'@typescript-eslint/no-unused-vars': ['error', { argsIgnorePattern: '^_' }],
},
settings: {
'import/resolver': {
node: {
extensions: ['.js', '.ts'],
},
},
'import/internal-regex':
'^(@deliveryhero|@honestfoodcompany|@google-cloud|google.*)(/.+)?$',
},
overrides: [
{
// For tests
files: ['*.test.{ts,js}', './**/__tests__/**/*.*'],
env: {
jest: true,
},
extends: ['plugin:jest/recommended'],
rules: {
'max-lines': 'off',
'import/no-unresolved': [
'error',
{ ignore: ['@honestfoodcompany/pubsub', '@deliveryhero/pubsub'] },
],
// These are off since we require dynamically after mocks are set
'@typescript-eslint/no-var-requires': 'off',
'global-require': 'off',
},
},
{
// For examples
files: ['./examples/**/*.*'],
rules: {
'import/no-unresolved': [
'error',
{ ignore: ['@honestfoodcompany/pubsub', '@deliveryhero/pubsub'] },
],
'@typescript-eslint/no-floating-promises': 'warn',
},
},
{
// Disable some TS rules for JS files
files: ['**/*.js'],
rules: {
'@typescript-eslint/no-var-requires': 'off',
'@typescript-eslint/explicit-function-return-type': 'off',
},
},
],
};