This repository was archived by the owner on May 27, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.eslintrc.js
81 lines (76 loc) · 1.91 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
const tsRules = {
'typescript/no-unused-vars': 'error',
'no-undef': 'off' // ts handles this
}
const reactRules = {
'react/react-in-jsx-scope': 'off',
'react/no-unknown-property': ['error', { ignore: ['class', 'for'] }],
'no-unused-vars': ['error', { varsIgnorePattern: '^h$' }],
'react/display-name': 'off', // annoying
'react/require-render-return': 'off', // buggy, doens't work with render props
'react/no-deprecated': 'off' // preact !== react
}
const unicornRules = {
'unicorn/prefer-spread': 'off'
}
const importRules = {
'import/first': 'error',
'import/no-duplicates': 'error',
// 'import/no-namespace': 'error', // needed in node (rollup config). TODO: switch to separate configs for web/node
// 'import/order': 'error' // broken for now, copies file contents over and over
'import/newline-after-import': 'error',
'import/no-named-default': 'error'
}
const promiseRules = {
'promise/no-return-wrap': 'error',
'promise/param-names': 'error',
'promise/no-nesting': 'error',
'promise/no-new-statics': 'error',
'promise/no-return-in-finally': 'error',
'promise/valid-params': 'error'
// 'promise/prefer-await-to-then': 'error'
}
module.exports = {
env: {
browser: true,
es6: true
},
parser: 'typescript-eslint-parser',
parserOptions: {
sourceType: 'module'
},
settings: {
react: {
pramga: 'h'
},
'import/resolver': {
node: true,
'eslint-import-resolver-typescript': true
}
},
extends: [
'eslint:recommended',
'plugin:jest/recommended',
'plugin:react/recommended',
'plugin:unicorn/recommended',
'plugin:array-func/recommended'
// 'plugin:jsx-a11y/recommended'
],
plugins: [
'react',
'jest',
'typescript',
'unicorn',
'import',
'promise',
'array-func'
// 'jsx-a11y'
],
rules: Object.assign(
reactRules,
tsRules,
unicornRules,
importRules,
promiseRules
)
}