forked from exivity-archive/react-orbitjs
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy path.eslintrc.js
76 lines (71 loc) · 1.92 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
module.exports = {
root: true,
parser: '@typescript-eslint/parser',
env: {
browser: true,
},
plugins: [
'prettier',
'@typescript-eslint',
'react-hooks',
],
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
'prettier',
"prettier/typescript",
"prettier/react",
],
// 0 = off, 1 = warn, 2 = error
rules: {
// typescript
'@typescript-eslint/explicit-member-accessibility': 'off', // private fields are coming to native JS classes
'@typescript-eslint/explicit-function-return-type': 'off', // TS is pretty good at inference
'@typescript-eslint/no-use-before-define': 'off', // this doesn't matter for side-effect-free modules
'@typescript-eslint/interface-name-prefix': 'off', // require interfaces start with I
'@typescript-eslint/no-non-null-assertion': 'off', // TS doesn't work with assert
'@typescript-eslint/no-object-literal-type-assertion': 'off', // don't know enough TS, I guess
'no-undef': 'off',
'no-unused-vars': 'off',
'no-fallthrough': 'off', // shorthand
'no-case-declarations': 'off',
// hooks
"react-hooks/rules-of-hooks": "error",
"react-hooks/exhaustive-deps": "warn",
// docs
"require-jsdoc": 'off',
// handled by prettier
'prettier/prettier': 'error',
'@typescript-eslint/indent': 'off',
},
overrides: [
// type-defs
{
files: ['types/**'],
rules: {
'@typescript-eslint/interface-name-prefix': 'off'
}
},
// node / config files
{
files: [
'config/**/*.js',
'tests/karma.conf.js',
'tests/test-setup.js',
'tests/karma.conf.js',
],
rules: {
'no-console': 'off',
'@typescript-eslint/no-var-requires': 'off'
},
parserOptions: {
sourceType: 'script',
ecmaVersion: 2015
},
env: {
browser: false,
node: true
}
}
]
};