This repository has been archived by the owner on Aug 21, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy path.eslintrc.js
46 lines (36 loc) · 1.44 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
module.exports = {
root: true,
extends: 'airbnb-base',
rules: {
// Allow to use braces if desired
'arrow-body-style': 0,
// Generally makes sense, but too strict to enforce
'class-methods-use-this': 0,
// Trailing commas on function arguments is just silly
'comma-dangle': ['error', {
arrays: 'always-multiline',
objects: 'always-multiline',
imports: 'always-multiline',
exports: 'always-multiline',
functions: 'never',
}],
// Saving 2 characters is not worth the potential errors
curly: 'error',
// A chain of 'if' and 'else if' statements is clearer than multiple individual 'if' blocks
'no-else-return': ['error', { allowElseIf: true }],
// Finding good names is hard so allow reuse
'no-param-reassign': 0,
// Increment with += 1 is just too long to type
'no-plusplus': 0,
// Finding good names is hard so allow reuse
'no-shadow': 0,
// This is still the best way to express the private api intent
'no-underscore-dangle': ['error', { allowAfterThis: true }],
// Allow functions to be used before defined because:
// 1) they are hoisted;
// 2) it allows code ordering that moves helper functions to the bottom.
'no-use-before-define': ['error', { functions: false, classes: true, variables: true }],
// To allow comment blocks that are actually section headers
'spaced-comment': ['error', 'always', { exceptions: ['/'] }],
},
};