forked from dimagi/commcare-hq
-
Notifications
You must be signed in to change notification settings - Fork 4
/
.eslintrc.js
64 lines (59 loc) · 2.08 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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
// http://eslint.org/
module.exports = {
"extends": "eslint:recommended",
// http://eslint.org/docs/user-guide/configuring#specifying-environments
"env": {
"browser": true,
},
// http://eslint.org/docs/user-guide/configuring#specifying-globals
"globals": {
// false means it shouldn't be overwritten
"define": false,
"hqDefine": false,
"hqImport": false,
"hqRequire": false,
"requirejs": false,
"gettext": false,
"ngettext": false,
"assert": false,
"sinon": false,
"$": false,
"ko": false,
"_": false,
"L": true,
"it": false,
"describe": false,
"beforeEach": false,
"nv": false,
"d3": false,
},
"plugins": [
"eslint-dimagi",
],
// http://eslint.org/docs/rules/
// http://eslint.org/docs/user-guide/configuring#configuring-rules
"rules": {
// First option can be off, warn, or error
"camelcase": ["error", {"properties": "never"}],
"comma-dangle": ["warn", "always-multiline"],
"eqeqeq": ["error"],
"func-call-spacing": ["error"],
"indent": ["warn", 4, {"SwitchCase":1}],
"linebreak-style": ["error", "unix"],
"key-spacing": ["error"],
"keyword-spacing": ["error"],
"no-implicit-globals": ["error"],
"no-irregular-whitespace": ["error"],
"no-new-object": ["error"],
"no-regex-spaces": ["error"],
"no-throw-literal": ["error"],
"no-unneeded-ternary": ["error"],
"no-whitespace-before-property": ["error"], // match flake8 E201 and E211
"semi": ["error", "always"],
"space-before-function-paren": ["error", {"anonymous": "always", "named": "never", "asyncArrow": "always"}],
"space-before-blocks": ["error"],
"space-in-parens": ["error", "never"],
"space-infix-ops": ["error"], // match flake8 E225
"eslint-dimagi/no-unblessed-new": ["error", ["Date", "Error", "FormData", "Option", "RegExp", "Clipboard", "MutationObserver"]],
}
};