This repository has been archived by the owner on Aug 8, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintrc.json
89 lines (75 loc) · 2.16 KB
/
.eslintrc.json
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
{
"env": {
// Defines globals exposed by modern browsers
"browser": true,
// Defines globals exposed by jQuery
"jquery": true,
// Defines globals exposed by Node.js
"node": true
},
"globals": {
// Stop complaining that lodash is undefined
"_": true
},
"installedESLint": true,
"parserOptions": {
"ecmaFeatures": {
"experimentalObjectRestSpread": true,
// add support for JSX
"jsx": true
}
},
"plugins": [
"react"
],
// Our rules
"rules": {
// Two space indent
"indent": ["error", 2],
// Force use of === and !==
"eqeqeq": ["error"],
// Spaces and style
"array-bracket-spacing": ["error", "never"],
"block-spacing": ["error", "never"],
"brace-style": ["error", "1tbs"],
"camelcase": ["error"],
"comma-dangle": ["error", "never"],
"eol-last": "error",
// Require curly brackets around everything
// no more if(foo) bar;
"curly": ["error", "all"],
// No assignment in conditionals
// eg. if(foo = "bar"){...}
// foo is now "bar", regardless
"no-cond-assign": ["error", "always"],
// Force double quotes
// May change to single quotes to match rails
// styleguide
"quotes": ["error","double"],
// Rquire semicolons
"semi": ["error","always"],
// But not too many semicolons
"no-extra-semi": ["error"],
// Disable duplicate keys in objects
// eg. { foo: "bar", foo: "baz" }
"no-dupe-keys": ["error"],
// Highlight left over debuggers
"no-debugger": ["error"],
// Highlight duplicate case stemement labels
"no-duplicate-case": ["error"],
// Require a "default" case in switch statements
"default-case": ["error"],
// Stop if(condition) {} else { if(condition} {} }
// Should be if(condition) {} else if(condition) {}
"no-lonely-if": "error",
// Misc best practices
"linebreak-style": ["error","unix"],
"use-isnan": ["error"],
"no-invalid-regexp": ["error"],
"strict": ["error", "global"],
"no-redeclare": ["error", { "builtinGlobals": true }],
"no-fallthrough": ["error"],
"no-undef": ["error"],
"no-unused-vars": ["error"]
}
}