-
Notifications
You must be signed in to change notification settings - Fork 1
/
.eslintrc.js
120 lines (92 loc) · 3.33 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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
module.exports = {
root: true,
extends: [
'airbnb',
'plugin:flowtype/recommended',
'plugin:jest/recommended',
],
plugins: [
'flowtype',
'jest',
],
env: {
'jest': true,
},
// overrides the airbnb ruleset
rules: {
// 4-space indent
'indent': ['error', 4, { SwitchCase: 1 }],
// require space before function opening parenthesis
'space-before-function-paren': ['error', 'always'],
// allow console methods
'no-console': 'off',
// quote all or no props in an object, disallow mixing
'quote-props': ['error', 'consistent'],
// never assign to a fn param, but allow assignment to its props
'no-param-reassign': ['error', { 'props': false }],
// allow padded blocks
'padded-blocks': 'off',
// enforce braces
'curly': ['error', 'all'],
// check that when we import default from our own code, there's a default export
'import/default': 'error',
// check that named imports exist in the exports
'import/named': 'error',
// check that wildcard imports '* as foo' exist when dereferenced
'import/namespace': 'error',
// check that external modules are referenced directly in package.json
// as dependencies, devDependencies or optionalDependencies.
'import/no-extraneous-dependencies': ['error', {
'devDependencies': true,
'optionalDependencies': true,
}],
// disallow use of exported name as name of default import,
// as it's likely you missed some brackets.
'import/no-named-as-default': 'error',
// imports always come first
'import/imports-first': ['error', ''],
// disallow use of exported name as property on the default export,
// as this is likely to confuse.
'import/no-named-as-default-member': 'error',
// ensure imports are in a consistent order:
'import/order': ['error', {
'groups': ['builtin', 'external', 'internal', 'parent', 'sibling', 'index'],
}],
// must separate imports from rest of code
'import/newline-after-import': 'error',
// import must include extensions for all files except these
"import/extensions": [
"error",
"always",
{
"js": "never",
"jsx": "never",
"es": "never"
}
],
// allow dynamic requires
"import/no-dynamic-require": 'off',
// allow 'require' anywhere
'global-require': 'off',
'no-underscore-dangle': ['error', {
'allowAfterThis': false,
'allow': [
'__', // for Ramda's R.__
],
}],
'no-warning-comments': [
'warn', {
'terms': ['::TODO::'],
'location': 'start',
}
],
'generator-star-spacing': ['error', { 'before': true, 'after': true }],
'object-curly-newline': 'off',
// jsx-a11y has refactored href-no-hash to anchor-is-valid:
// waiting for eslint-config-airbnb to catch up (out-of-date at v15.1.0)
'jsx-a11y/href-no-hash': 'off',
},
// add as they're encountered
globals: {
},
};