This repository has been archived by the owner on Apr 17, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 16
/
.eslintrc
67 lines (67 loc) · 2.2 KB
/
.eslintrc
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
{
// Extend the AirBnb lint config
"extends": "airbnb",
"parserOptions": {
"ecmaVersion": 6,
"ecmaFeatures": {
"experimentalObjectRestSpread": true,
"globalReturn": true,
"impliedStrict": true,
"jsx": true,
},
"sourceType": "module",
},
"env": {
"es6": true,
"browser": true,
"node": true,
"jquery": true,
// Optional Enables
"webextensions": false, // Enable if using Web Extensions
// Optional Testing Frameworks
"jasmine": false, // Enable if using Jasmine testing framework
"protractor": false, // Enable if using Protractor testing framework
"mocha": false // Enable if using Mocha testing framework
},
"globals": {
"jQuery": true,
"angular": false, // Enable if using Angular
},
// Do NOT change these rules
"rules": {
"indent": [2, 2, {"SwitchCase": 1}],
"max-len": [2, 80, 4, {
"ignoreComments": true,
"ignoreUrls": true,
"ignoreStrings": true,
"ignoreTemplateLiterals": true
}],
"quotes": [2, "single"], // Allows template literals if they have substitutions or line breaks
"semi": [2, "always"],
"no-multiple-empty-lines": [2, {"max": 1}],
"comma-dangle": [2, "always-multiline"],
"dot-location": [2, "property"],
"one-var": [2, "never"],
"no-var": [2], // Stop using var, use const or let instead
"prefer-const": ["error"],
"no-bitwise": [2],
"id-length": ["error", {
"properties": "never",
"exceptions": ["x", "y", "i", "e", "n", "k"]
}],
"func-names": [1, "always"], // This aids in debugging
"no-use-before-define": [2, "nofunc"],
"yoda": [2, "always"],
"object-curly-spacing": [2, "always"],
"array-bracket-spacing": [2, "never"],
"space-unary-ops": [2, {"words": true, "nonwords": false, "overrides": {"!": true}}],
"keyword-spacing": ["error", {"after": true}],
"space-before-blocks": [2, "always"],
"space-in-parens": [2, "never"],
"spaced-comment": [2, "always"],
"no-confusing-arrow": ["error", {"allowParens": true}], // See eslint config for reasons
"no-constant-condition": ["error"],
"arrow-parens": ["error", "always"],
"operator-linebreak": ["error", "after"]
}
}