-
Notifications
You must be signed in to change notification settings - Fork 4
/
.eslintrc.js
93 lines (81 loc) · 2.88 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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
module.exports = {
root: true,
env: { node: true },
parser: "@typescript-eslint/parser",
plugins: [
"@typescript-eslint",
],
extends: [
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
],
ignorePatterns: ["src/lambda/build/*"],
rules: {
// Usages of `{}` and `object` look fine in this repo
"@typescript-eslint/ban-types": ["error", {
"extendDefaults": true,
"types": {
"{}": false,
"object": false,
},
}],
// Already handled by typescript
"@typescript-eslint/no-unused-vars": "off",
// I don't like it
"@typescript-eslint/explicit-module-boundary-types": "off",
// Interface/type delimiter styles, prefer comma
"@typescript-eslint/member-delimiter-style": ["warn", {
"multiline": {
"delimiter": "comma",
"requireLast": true,
},
"singleline": {
"delimiter": "comma",
"requireLast": false,
},
"multilineDetection": "brackets",
}],
// Semicolon
"semi": "off",
"@typescript-eslint/semi": ["error"],
// Trailing comma
"comma-dangle": "off",
"@typescript-eslint/comma-dangle": ["error", {
"arrays": "always-multiline",
"objects": "always-multiline",
"imports": "always-multiline",
"exports": "always-multiline",
"functions": "always-multiline",
"enums": "always-multiline",
"generics": "always-multiline",
"tuples": "always-multiline",
}],
// Quotes
"quotes": "off",
"@typescript-eslint/quotes": ["error"],
// Spacing around type annotations
"@typescript-eslint/type-annotation-spacing": ["error"],
// Curly spacing
"object-curly-spacing": "off",
"@typescript-eslint/object-curly-spacing": ["error", "always"],
// Shadowing requires paying close attention during debug
"no-shadow": "off",
"@typescript-eslint/no-shadow": ["error"],
// No extra parens
"arrow-parens": ["error", "as-needed"],
"no-extra-parens": "off",
"@typescript-eslint/no-extra-parens": ["error", "all", {
"conditionalAssign": true,
"returnAssign": true,
"nestedBinaryExpressions": false,
"enforceForArrowConditionals": true,
"enforceForSequenceExpressions": true,
"enforceForNewInMemberExpressions": true,
"enforceForFunctionPrototypeMethods": true,
}],
// Spacing in template curlies
"template-curly-spacing": ["error", "always"],
// Indent
"indent": ["error", 4, { "SwitchCase": 1 , "flatTernaryExpressions": false }],
},
};