-
Notifications
You must be signed in to change notification settings - Fork 1
/
.eslintrc.json
188 lines (188 loc) · 5.86 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
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
{
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": 2020, // Allows for the parsing of modern ECMAScript features.
"sourceType": "module", // Allows for the use of imports.
"project": "./tsconfig.json"
},
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/eslint-recommended",
"plugin:@typescript-eslint/recommended",
"plugin:@typescript-eslint/recommended-requiring-type-checking"
],
"plugins": [
"sort-imports-es6-autofix"
],
"rules": {
"@typescript-eslint/explicit-function-return-type": "off",
// Disallows calls to methods of the console object.
"no-console": "warn",
// Require semi colon.
"semi": "error",
// Enforces a consistent indentation style.
"indent": [
"error",
2
],
// Enforces consistent line endings independent of operating system, VCS, or editor used across your codebase.
"linebreak-style": [
"error",
"unix"
],
// Enforces the consistent use double quotes.
"quotes": [
"error",
"double"
],
// Enforces parentheses around arrow function parameters, as needed.
"arrow-parens": [
"error",
"as-needed"
],
// Enforces at least one newline (or absence thereof) at the end of non-empty files.
"eol-last": [
"error"
],
// Enforce consistent spacing before function parentheses and as such.
"space-before-function-paren": [
"error",
{
"anonymous": "never",
"named": "never",
"asyncArrow": "never"
}
],
// Create space before/after the arrow function's arrow.
"arrow-spacing": [
"error",
{
"before": true,
"after": true
}
],
// Ensuring there are spaces around infix operators.
"space-infix-ops": [
"error",
{
"int32Hint": false
}
],
// Enforce consistency of spacing before blocks.
"space-before-blocks": [
"warn",
"always"
],
// Enforces consistent line breaks inside braces of object literals or destructuring assignments.
"object-curly-newline": [
"warn",
{
"multiline": true,
"minProperties": 4
}
],
// Enforces consistent spacing inside braces of object literals, destructuring assignments, and import/export specifiers.
"object-curly-spacing": [
"warn",
"always"
],
// Enforces consistent brace style for blocks.
"brace-style": [
"warn",
"stroustrup"
],
// Checks all import declarations and verifies that all imports are first sorted by the used member syntax and then alphabetically by the first member or alias name.
"sort-imports-es6-autofix/sort-imports-es6": [
"warn",
{
"ignoreCase": true,
"ignoreMemberSort": false,
"memberSyntaxSortOrder": [
"none",
"all",
"multiple",
"single"
]
}
],
// Enforce consistent spacing directly inside of parentheses, by disallowing or requiring one or more spaces to the right of ( and to the left of ).
"space-in-parens": [
"error",
"never"
],
// Enforce consistency of spacing after the start of a comment // or /*.
"spaced-comment": [
"error",
"always",
{
"exceptions": [
"-",
"+"
]
}
],
// Enforces consistent spacing between keys and values in object literal properties.
"key-spacing": [
"error",
{
"afterColon": true
}
],
// Disallow multiple whitespace around logical expressions, conditional expressions, declarations, array elements, object properties, sequences and function parameters.
"no-multi-spaces": [
"error"
],
// Declare variables first, rather than having ES6 hoisting them to the top of the scope
"no-use-before-define": [
"error",
{
"functions": false,
"classes": false
}
],
// Do not recreate variables with existing/identical names
"no-shadow": "off",
"@typescript-eslint/no-shadow": "error",
// Remove trailing whitespaces immediately, rather than possibly having unnecessary one-line changes in git later
"no-trailing-spaces": "warn",
// Require trailing commas on multiline array and objects
"comma-dangle": [
"warn",
{
"arrays": "only-multiline",
"objects": "only-multiline"
}
],
// Do not include spacing in object property lookups like object["somekey"]
"computed-property-spacing": [
"warn",
"never"
],
// Require spacing after comma, forbid before
"comma-spacing": "warn",
// Require use of 'let' and 'const'
"no-var": "error",
// Add an additional set of parathesis around iife functions to hint the reader about the iife
"wrap-iife": [
"warn",
"outside"
],
// Require triple equals. The behavior of double equals might not behave as the coder expects
"eqeqeq": "error",
// Prefer dot notation referencing in object notation. Eg: object["somekey"] => object.somekey
"dot-notation": "warn",
// Require the dot notation to appear on the same line as the object, eg:
// NOT: INSTEAD:
// someobject. someobject
// somekey .somekey
// Require curly brackets on all if/else/for statements
"curly": "error",
"@typescript-eslint/no-misused-promises": [
"error",
{
"checksVoidReturn": false
}
],
"@typescript-eslint/camelcase": "off"
}
}