forked from mapbox/mapbox-gl-js-mock
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintrc.js
73 lines (73 loc) · 2.4 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
65
66
67
68
69
70
71
72
73
module.exports = {
"env": {
"browser": true,
"node": true,
"commonjs": true,
"es6": true
},
"extends": "eslint:recommended",
"parserOptions": {
"sourceType": "module"
},
"rules": {
// possible errors
"no-template-curly-in-string": "error",
"no-debugger": "warn",
"no-unused-vars": 0,
// best practices
"curly": [ "error", "all" ],
"dot-location": ["error", "property"],
"eqeqeq": "error",
"no-eval": "error",
"no-implicit-globals": "error",
"no-loop-func": "error",
"no-multi-spaces": ["error", { ignoreEOLComments: true }],
"no-script-url": "error",
"radix": ["error", "always"],
// variables
"init-declarations": ["error", "always"],
"no-shadow": "error",
// "no-use-before-define": ["error", {
// "functions": false
// }],
//Node.js and CommonJS
"no-mixed-requires": "error",
// stylistic issues
"brace-style": ["error", "1tbs", {
"allowSingleLine": true
}],
"comma-dangle": ["error", "never"],
"comma-spacing": ["error", {
"before": false,
"after": true
}],
"func-call-spacing": ["error", "never"],
"id-length": ["error", {
"exceptions": ["e", "i","j","k","r","$","_","x","y", "L"]
}], // min is 2 chars
"indent": ["error", 4],
"max-depth": ["error", 4],
"max-len": ["error", 120, {
"ignoreUrls": true,
"ignoreStrings": true,
"ignoreRegExpLiterals": true,
"ignoreTemplateLiterals": true
}],
"new-cap": "error",
"no-trailing-spaces": "error",
"quotes": ["error", "single"],
"semi": ["error", "always"],
"camelcase": ["error", { properties: "never" } ],
"spaced-comment": ["error", "always"],
"space-infix-ops": "error",
// ES6
"arrow-spacing": "error",
"prefer-const": "error",
"prefer-template": "error",
"no-console": "warn"
}
};
// For more info and more detailed explanations about the linting rules applied
// see: http://eslint.org/docs/rules/
// How to turn off specific rule for a specific line of code:
// see: https://stackoverflow.com/questions/27732209/turning-off-eslint-rule-for-a-specific-line