This repository has been archived by the owner on Aug 3, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patheslintrc-style.js
77 lines (57 loc) · 1.79 KB
/
eslintrc-style.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
// Rules for enforcing a consistent code style.
module.exports = {
"rules": {
// We use 2-space indentation.
"indent": ["warn", 2, {
// Indent cases in a switch statement.
"SwitchCase": 1,
// Indent properties of an object.
//
// doSomething()
// .then(() => doSomethingElse());
"MemberExpression": 1
}],
// Always use semicolons.
"semi": ["error", "always"],
// Keep commas consistent between JS and JSON.
"comma-dangle": ["error", "never"],
// (foo) => { ... } and
// foo => { ... } are permitted.
"arrow-parens": "off",
// Avoid [ 1 ] and foo[ 1 ]. Prefer [1].
"array-bracket-spacing": "warn",
"computed-property-spacing": "warn",
// Avoid {x}. Prefer { x }.
"block-spacing": "warn",
// Braces go on the line, not below it. Prefer:
//
// foo {
// }
//
// over
//
// foo
// {
// }
"brace-style": ["error", "1tbs", { allowSingleLine: true }],
// useCamelCaseForVariables, not_underscores.
"camelcase": ["warn", { properties: "always" }],
// If `this` needs to be aliased, use `self`.
"consistent-this": ["warn", "self"],
// Use { key: "value" } for key spacing. (Not { key : "value" } or variants.)
"key-spacing": "warn",
"object-curly-spacing": ["warn", "always"],
// Use `if (true)`, not `if(true)`. (This is for all keywords.)
"keyword-spacing": "warn",
// Enforce a space after a semicolon.
"semi-spacing": ["warn", { after: true }],
// Enforce a space after a comment.
"spaced-comment": "warn",
// Prefer `() => {}` to `()=>{}`.
"arrow-spacing": "warn",
// Prefer `${foo}` over `${ foo }`.
"template-curly-spacing": "warn",
// Because sometimes we forget.
"eol-last": "warn"
}
};