-
Notifications
You must be signed in to change notification settings - Fork 2
/
.eslintrc.js
108 lines (108 loc) · 3.15 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
module.exports = {
env: {
browser: true,
es6: true,
node: true,
},
extends: ["airbnb-base", "plugin:@typescript-eslint/recommended"],
globals: {
Atomics: "readonly",
SharedArrayBuffer: "readonly",
},
parser: "@typescript-eslint/parser",
parserOptions: {
ecmaVersion: 2018,
sourceType: "module",
},
plugins: ["@typescript-eslint"],
settings: {
"import/resolver": {
node: {
extensions: [".ts", ".js"],
},
},
},
rules: {
"@typescript-eslint/explicit-function-return-type": "off",
"@typescript-eslint/explicit-module-boundary-types": "off",
"@typescript-eslint/indent": ["error", 2],
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/member-delimiter-style": [
"error",
{
multiline: {
delimiter: "none",
requireLast: false,
},
singleline: {
delimiter: "semi",
requireLast: false,
},
},
],
"arrow-parens": [2, "as-needed", { requireForBlockBody: true }],
"consistent-return": "off",
eqeqeq: "off",
"func-names": "off",
"implicit-arrow-linebreak": "off",
"import/extensions": [
"error",
{
ts: "never",
},
],
"import/no-extraneous-dependencies": "off",
"import/prefer-default-export": "off",
indent: "off",
"max-classes-per-file": "off",
"max-len": [
"error",
{
code: 160,
ignoreStrings: true,
ignoreTemplateLiterals: true,
ignoreRegExpLiterals: true,
},
],
"no-await-in-loop": "off",
"no-cond-assign": "off",
"no-console": "off",
"no-continue": "off",
"no-dupe-class-members": "off",
"no-multi-assign": "off",
"no-multiple-empty-lines": ["warn", { max: 1 }],
"no-new-wrappers": "off",
"no-param-reassign": ["error", { props: false }],
"no-plusplus": "off",
"no-restricted-syntax": [
"error",
{
selector: "ForInStatement",
message:
"for..in loops iterate over the entire prototype chain, which is virtually never what you want. Use Object.{keys,values,entries}, and iterate over the resulting array.",
},
// disable this one in order to allow sequentially awaiting on a list of promises
// {
// selector: 'ForOfStatement',
// message: 'iterators/generators require regenerator-runtime, which is too heavyweight for this guide to allow them. Separately, loops should be avoided in favor of array iterations.',
// },
{
selector: "LabeledStatement",
message:
"Labels are a form of GOTO; using them makes code confusing and hard to maintain and understand.",
},
{
selector: "WithStatement",
message:
"`with` is disallowed in strict mode because it makes code impossible to predict and optimize.",
},
],
"no-return-assign": "off",
"no-shadow": "off",
"no-use-before-define": "off",
"object-curly-newline": ["error", { consistent: true }],
"object-shorthand": ["error", "always", { avoidQuotes: false }],
"require-yield": "off",
semi: ["error", "never"],
},
};