-
Notifications
You must be signed in to change notification settings - Fork 13
/
.eslintrc.js
76 lines (76 loc) · 2.41 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
74
75
76
// Documentation:
// http://eslint.org/docs/rules/
module.exports = {
"parserOptions":{
"ecmaVersion": 2017
},
"env": {
"googleappsscript/googleappsscript": true
},
"plugins":[
"googleappsscript"
],
"extends": "eslint:recommended",
"rules": {
"max-len": [
"error",
{
"code": 120,
"ignoreComments": true,
"ignoreUrls": true,
"ignoreTemplateLiterals": true,
}
],
// Braces should be on their own lines
"brace-style": [
"error",
"1tbs",
{"allowSingleLine": true}
],
// Indent code with 4 spaces
"indent": [
"error",
2,
{
"SwitchCase": 1,
"MemberExpression": 1,
"ObjectExpression": "first"
}
],
// Objects with more than 3 properties should be on multiple lines
"object-curly-newline": [
"error",
{
"multiline": true,
"minProperties": 5,
"consistent": true
}
],
// Objects should have spaces around curly braces for readability
"object-curly-spacing": [
"error",
"always"
],
// Use double quotes for strings
"quotes": [
"error",
"single"
],
// Always include optional semicolons
"semi": [
"error",
"always"
],
"no-console": "off",
"default-case": 2, // Switch statements should always have a default case
"keyword-spacing": 2, // Ensure spaces are around keywords
"no-array-constructor": 2, // Do not allow Array(), use [] notation instead
"no-bitwise": 2, // Disallow bitwise operators
"no-multiple-empty-lines": 2, // Do not allow more than 2 consecutive newlines
"curly": 2, // Control structures should always have curly braces
"no-extend-native": 2, // Disallow extending of native javascript objects
"no-caller": 2, // Disallow use of caller/callee
"no-shadow": 2, // Disallow shadowed variable declarations
"dot-notation": 2, // Enforce dot notation when possible
}
};