-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy path.eslintrc.js
58 lines (50 loc) · 1.73 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
module.exports = {
root: true,
parser: "@typescript-eslint/parser",
parserOptions: {
"ecmaVersion": 2018,
"sourceType": "module",
},
plugins: [
"@typescript-eslint",
],
extends: [
"eslint:recommended",
"plugin:@typescript-eslint/eslint-recommended",
"plugin:@typescript-eslint/recommended",
],
rules: {
// enforce spacing before and after comma
// https://eslint.org/docs/rules/comma-spacing
"comma-spacing": ['error', { before: false, after: true }],
// require the use of === and !==
// https://eslint.org/docs/rules/eqeqeq
eqeqeq: ["warn", "always"],
"no-var": "error",
// enforce the consistent use of either backticks, double, or single quotes
// https://eslint.org/docs/rules/quotes
quotes: ["error", "double"],
// disallow `else` blocks after `return` statements in `if` statements
// https://eslint.org/docs/rules/no-else-return
"no-else-return": ["error", { allowElseIf: false }],
// require `let` or `const` instead of `var`
// https://eslint.org/docs/rules/no-var
"no-var": "error",
// require or disallow semicolons instead of ASI
// https://eslint.org/docs/rules/semi
semi: "error",
// enforce consistent spacing before and after semicolons
// https://eslint.org/docs/rules/semi-spacing
"semi-spacing": ["error", { "before": false, "after": true }],
// require or disallow space before function opening parenthesis
// https://eslint.org/docs/rules/space-before-function-paren
"space-before-function-paren": ["error", {
anonymous: "always",
named: "never",
asyncArrow: "always"
}],
// Enforce spacing around colons of switch statements
// https://eslint.org/docs/rules/switch-colon-spacing
"switch-colon-spacing": ["error", { after: true, before: false }],
}
};