-
Notifications
You must be signed in to change notification settings - Fork 13
/
.eslintrc.json
147 lines (142 loc) · 5.05 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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
{
"env": {
"browser": false,
"node": true,
"es6": true,
"mocha": true
},
"parserOptions": {
"ecmaVersion": 8,
"sourceType": "module",
"ecmaFeatures": {
"jsx": true
}
},
"extends": [
"eslint:recommended"
],
"rules": {
// Possible Syntax
"no-console": "warn",
"no-control-regex": "warn",
"no-empty": ["error", { "allowEmptyCatch": true }],
// Best Practices
"block-scoped-var": "warn",
"complexity": ["warn", 15],
"consistent-return": "warn",
"curly": ["error", "all"],
"default-case": "error",
"dot-location": ["error", "property"],
"dot-notation": "error",
"eqeqeq": "error",
"guard-for-in": "warn",
"no-alert": "warn",
"no-caller": "error",
"no-div-regex": "warn",
"no-else-return": "warn",
"no-empty-function": ["error", { "allow": ["constructors", "arrowFunctions"] }],
"no-eval": "warn",
"no-extra-label": "error",
"no-floating-decimal": "error",
"no-implied-eval": "warn",
"no-invalid-this": "error",
"no-iterator": "error",
"no-labels": "error",
"no-lone-blocks": "error",
"no-loop-func": "warn",
"no-multi-spaces": "error",
"no-multi-str": "error",
"no-new-func": "warn",
"no-octal-escape": "error",
"no-proto": "error",
"no-return-assign": "warn",
"no-script-url": "warn",
"no-self-compare": "error",
"no-throw-literal": "error",
"no-unmodified-loop-condition": "warn",
"no-unused-expressions": "warn",
"no-useless-call": "error",
"no-void": "error",
"no-warning-comments": ["warn", { "terms": ["todo", "fixme", "note"], "location": "start" }],
"require-await": "warn",
"yoda": "error",
// Variables
"no-delete-var": "warn",
"no-shadow": "warn",
"no-shadow-restricted-names": "error",
"no-undef-init": "error",
"no-use-before-define": "error",
// Node.js / CommonJS
"no-buffer-constructor": "error",
"no-new-require": "error",
"no-path-concat": "error",
// Formatting Rules
"array-bracket-newline": ["error", { "multiline": true }],
"array-bracket-spacing": ["warn", "never"],
"block-spacing": ["error", "always"],
"brace-style": ["error", "1tbs", { "allowSingleLine": true }],
"camelcase": ["error", { "properties": "always" }],
"comma-spacing": ["error", { "before": false, "after": true }],
"comma-style": ["error", "last"],
"computed-property-spacing": ["error", "never"],
"consistent-this": ["error", "self"],
"eol-last": ["error", "always"],
"func-call-spacing": ["error", "never"],
"function-paren-newline": ["error", "multiline"],
"id-length": ["error", { "min": 2, "max": 40 }],
"indent": ["error", 2, { "SwitchCase": 1 }],
"jsx-quotes": ["error", "prefer-double"],
"key-spacing": ["error", {"afterColon": true, "beforeColon": false, "mode": "minimum"}],
"keyword-spacing": ["error", {"before": true, "after": true}],
"linebreak-style": ["error", "unix"],
"lines-around-comment": ["error", { "beforeBlockComment": true }],
"lines-between-class-members": ["error", "always"],
"max-len": ["warn", { "code": 120 }],
"new-cap": "error",
"new-parens": "error",
"newline-per-chained-call": "error",
"no-array-constructor": "error",
"no-lonely-if": "error",
"no-multi-assign": "error",
"no-multiple-empty-lines": ["error", { "max": 2, "maxEOF": 1, "maxBOF": 1 }],
"no-new-object": "error",
"no-tabs": "error",
"no-unneeded-ternary": "error",
"no-whitespace-before-property": "error",
"object-curly-newline": ["error", { "multiline": true }],
"object-curly-spacing": ["error", "always"],
"operator-assignment": "warn",
"operator-linebreak": ["error", "after", { "overrides": { "?": "none", ":": "none" } }],
"quote-props": ["error", "as-needed"],
"quotes": ["error", "single"],
"semi": "error",
"semi-spacing": ["error", { "before": false, "after": true }],
"semi-style": ["error", "last"],
"space-before-blocks": "error",
"space-before-function-paren": ["error", "never"],
"space-in-parens": "error",
"space-infix-ops": "error",
"space-unary-ops": ["error", { "words": true, "nonwords": false }],
"spaced-comment": ["warn", "always"],
"switch-colon-spacing": ["error", {"after": true, "before": false}],
"template-tag-spacing": "error",
// ES6 Formatting Rules
"arrow-body-style": ["error", "always"],
"arrow-parens": "error",
"arrow-spacing": ["error", { "before": true, "after": true }],
"generator-star-spacing": ["error", { "before": true, "after": false }],
"no-confusing-arrow": "error",
"no-var": "warn",
"object-shorthand": ["error", "consistent"],
"prefer-arrow-callback": "error",
"prefer-const": "warn",
"prefer-numeric-literals": "warn",
"prefer-rest-params": "warn",
"prefer-spread": "warn",
"prefer-template": "warn",
"rest-spread-spacing": "error",
"symbol-description": "error",
"template-curly-spacing": "error",
"yield-star-spacing": ["error", {"before": true, "after": false}]
}
}