-
Notifications
You must be signed in to change notification settings - Fork 24
/
.eslintrc.js
144 lines (141 loc) · 5.02 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
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
module.exports = {
parser: "@typescript-eslint/parser",
extends: [
"plugin:@typescript-eslint/recommended",
"plugin:import/errors",
"plugin:import/warnings",
"plugin:import/typescript",
"plugin:prettier/recommended" // Make sure this is always the last configuration in the extends array.
],
plugins: ["prettier", "@typescript-eslint", "header", "import"],
parserOptions: {
ecmaVersion: 2018,
sourceType: "module",
project: "./tsconfig.eslint.json"
},
env: {
node: true,
es6: true,
jest: true
},
rules: {
"@typescript-eslint/array-type": ["error", { default: "array" }],
"@typescript-eslint/member-ordering": "off",
"@typescript-eslint/prefer-for-of": "error",
"@typescript-eslint/no-parameter-properties": "off",
"@typescript-eslint/no-empty-interface": "off",
"@typescript-eslint/no-inferrable-types": "off",
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/no-use-before-define": "off",
"@typescript-eslint/no-object-literal-type-assertion": "off",
"@typescript-eslint/no-unused-vars": ["warn", { args: "none" }],
"@typescript-eslint/explicit-function-return-type": "off",
"@typescript-eslint/explicit-module-boundary-types": "off",
"@typescript-eslint/explicit-member-accessibility": [
"error",
{
accessibility: "no-public",
overrides: {
parameterProperties: "explicit"
}
}
],
"@typescript-eslint/ban-types": [
"error",
{
types: {
Object: {
message: "Avoid using the `Object` type.",
fixWith: "object"
},
Function: {
message:
"Avoid using the `Function` type. Prefer a specific function type, like `() => void`, or use `ts.AnyFunction`.",
fixWith: "() => void"
},
Boolean: {
message: "Avoid using the `Boolean` type. ",
fixWith: "boolean"
},
Number: {
message: "Avoid using the `Number` type.",
fixWith: "number"
},
String: {
message: "Avoid using the `String` type.",
fixWith: "string"
}
}
}
],
"arrow-parens": ["warn", "as-needed"],
"no-constant-condition": ["warn", { checkLoops: false }],
"no-else-return": "warn",
"no-empty": ["warn", { allowEmptyCatch: true }],
"no-empty-function": ["warn", { allow: ["constructors"] }],
"no-eval": "error",
"no-lone-blocks": "error",
"no-lonely-if": "error",
"no-loop-func": "error",
"no-multi-spaces": "error",
"no-return-assign": "error",
"no-sequences": "error",
"no-template-curly-in-string": "warn",
"no-throw-literal": "error",
"no-unmodified-loop-condition": "warn",
"no-unneeded-ternary": "error",
"no-use-before-define": "off",
"no-useless-call": "error",
"no-useless-catch": "error",
"no-useless-computed-key": "error",
"no-useless-concat": "error",
"no-useless-rename": "error",
"no-useless-return": "error",
"no-var": "error",
"no-with": "error",
"prefer-const": "error",
"prefer-numeric-literals": "error",
"prefer-object-spread": "error",
"prefer-rest-params": "error",
"prefer-spread": "error",
"prefer-template": "error",
"sort-imports": [
"error",
{
ignoreCase: true,
ignoreDeclarationSort: true,
ignoreMemberSort: false,
memberSyntaxSortOrder: ["none", "all", "multiple", "single"]
}
],
"import/export": "off",
"import/named": "off",
"import/no-unresolved": [
"warn",
{ ignore: ["vscode", "../../proto"] }
],
"import/namespace": "off",
"import/newline-after-import": "warn",
"import/extensions": ["error", "never"],
"import/order": [
"warn",
{
"groups": ["builtin", "external", "internal", ["index", "sibling", "parent"]],
"newlines-between": "always"
}
],
"header/header": [
2,
"block",
[
"!",
{
pattern: " * Copyright \\d{4}-\\d{4} VMware, Inc\\.",
template: " * Copyright 2018-2021 VMware, Inc."
},
" * SPDX-License-Identifier: MIT",
" "
]
]
}
}