forked from visgl/react-google-maps
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintrc.js
65 lines (60 loc) · 1.74 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
// @ts-check
module.exports = {
plugins: ['react', 'import', 'react-hooks', '@typescript-eslint'],
extends: ['prettier', 'plugin:@typescript-eslint/recommended'],
parser: '@typescript-eslint/parser',
env: {
node: true,
browser: true,
es6: true
},
globals: {
google: true
},
ignorePatterns: ['node_modules', '**/dist*/**/*.js'],
parserOptions: {
ecmaVersion: 2020,
sourceType: 'module'
},
rules: {
'no-continue': 'off',
'no-console': ['error', {allow: ['warn', 'error']}]
},
overrides: [
{
files: ['examples/**/*'],
rules: {
'no-process-env': 'off'
}
},
{
files: ['./{src,examples}/**/*.{ts,mts,cts,tsx}'],
rules: {
// Some of JS rules don't always work correctly in TS and
// hence need to be reimported as TS rules
'no-redeclare': 'off',
'no-shadow': 'off',
'no-use-before-define': 'off',
'no-dupe-class-members': 'off',
// typescript does a good job tracking return types
'consistent-return': 'off',
'no-undef': 'off',
'react-hooks/rules-of-hooks': 'error',
'react-hooks/exhaustive-deps': 'warn',
// We use function hoisting to put exports at top of file
'@typescript-eslint/no-use-before-define': 'off',
'@typescript-eslint/no-dupe-class-members': ['error'],
// We encourage explicit typing, e.g `field: string = ''`
'@typescript-eslint/no-inferrable-types': 'off'
},
parserOptions: {project: ['**/tsconfig.json']}
},
{
files: ['**/__tests__/**/*.{ts,tsx}'],
rules: {
'@typescript-eslint/no-empty-function': 'off',
'@typescript-eslint/no-non-null-assertion': 'off'
}
}
]
};