-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
51 lines (43 loc) · 1.42 KB
/
index.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
/**
* This is DoSomething.org's shared ESLint config
* for enforcing consistent code style in our JavaScript
* projects. It's based on Airbnb's JavaScript style guide.
*
* @see https://github.com/DoSomething/code-style/tree/master/javascript
* @see https://github.com/airbnb/javascript
*/
module.exports = {
extends: [
'airbnb',
'prettier',
],
// We make a few tweaks to the stock rules:
rules: {
// Do not require named functions.
'func-names': 0,
// Allow common iterator variable names.
'id-length': [2, { exceptions: ['i', 'j', 'k', '$'] }],
// We like, but don't require destructuring.
'prefer-destructuring': 'off',
'react/destructuring-assignment': 'off',
// Don't warn when using Mongo or GraphQL's meta fields.
'no-underscore-dangle': ['warn', { allow: ['_id', '__typename', '__schema'] }],
// Require multi-line curly braces for all conditionals.
'brace-style': ['error', '1tbs', { allowSingleLine: false }],
curly: ['error', 'all'],
// Disable 'no-return-assign' because it makes common
// patterns like React's refs unwieldy.
'no-return-assign': 'off',
// Require imports to be grouped by type (packages, then internal files).
'import/order': [
'error',
{
'newlines-between': 'always',
groups: [
['builtin', 'external'],
['parent', 'sibling', 'internal', 'index'],
],
},
],
},
};