-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintrc.json
95 lines (85 loc) · 3.5 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
90
91
92
93
94
95
{
// https://standardjs.com/
"extends": "standard",
"env": {
"browser": true
},
// These are known global variables we reference. By default, any reference
// to an undeclared variable causes a warning. These overrides that warning
// because we know what we are doing with these.
// https://eslint.org/docs/user-guide/configuring#specifying-globals
"globals": {
// Please keep this list alphabetized.
"$": false,
"Romo": false,
"RomoConfig": false,
"RomoEnv": false
},
// These are overrides to StandardJS rules.
"rules": {
// This enforces using `===` and `!==` except for comparing two literal
// values, evaluating the value of typeof, and comparing against null
// https://eslint.org/docs/rules/eqeqeq
// if (foo === true) {}
// if (foo == null) {} // allows for checking both null/undefined at once
// if (typeof foo == 'undefined') {}
"comma-dangle": ["error", {
"arrays": "always-multiline",
"objects": "always-multiline",
"imports": "always-multiline",
"exports": "always-multiline",
"functions": "only-multiline"
}],
// This enforces using `===` and `!==` except for comparing two literal
// values, evaluating the value of typeof, and comparing against null
// https://eslint.org/docs/rules/eqeqeq
// if (foo === true) {}
// if (foo == null) {} // allows for checking both null/undefined at once
// if (typeof foo == 'undefined') {}
"eqeqeq": ["error", "smart"],
"key-spacing": ["error", {
"mode": "minimum",
"align": "value"
}],
// This rule enforces a maximum line length to increase code readability
// and maintainability. The length of a line is defined as the number of
// Unicode characters in the line.
"max-len": ["error", {
"code": 100, // prefer 80 or less, but fail on more than 100
"ignoreUrls": true, // ignores lines that contain a URL
"ignoreTemplateLiterals": true, // ignores lines that contain a literal
"ignoreRegExpLiterals": true // ignores lines that contain a RegExp
}],
// This is good by default except when you are doing meta-programming and
// you have a dynamic class stored as a variable or returned from a
// function. This should be rare outside of code that touches 3rd-party
// libraries or our internal libraries. We should avoid this in our
// standard feature code. Therefore, as libraries need to use a technique
// like this, we can call it out here.
// https://eslint.org/docs/rules/new-cap
"new-cap": ["error", {
"newIsCapExceptions": [
// Please keep this list alphabetized.
"popoverOwnerClass",
"this.class" // `this.class` is always a constructor for Romo-defined objects
]
}],
// Allow creating instances of objects and not keeping a reference to them.
// Since we are OO developers we like creating objects to encapsulate
// state and behavior. Many times that object is autonomous, not needing
// any further interaction from the thing that created it.
// https://eslint.org/docs/rules/no-new
"no-new": ["off"],
// Too many false-positives
"no-useless-escape": ["off"],
// This keeps function definitions looking more like they do in Ruby.
// https://eslint.org/docs/rules/space-before-function-paren
// var foo = function(x) {}
// var foo = async (x) => 1
"space-before-function-paren": ["error", {
"anonymous": "never",
"named": "never",
"asyncArrow": "always"
}]
}
}