forked from online-go/online-go.com
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintrc.js
153 lines (149 loc) · 5.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
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
module.exports = {
env: {
browser: true,
es6: true,
},
parser: "@typescript-eslint/parser",
parserOptions: {
project: "tsconfig.json",
sourceType: "module",
},
plugins: [
"eslint-plugin-jsdoc",
"@typescript-eslint",
"@typescript-eslint/tslint",
"prettier",
"react-hooks",
],
extends: ["eslint:recommended", "plugin:@typescript-eslint/recommended", "prettier"],
rules: {
// Recommended rules with errors
// TODO: Fix these and re-enable them
"@typescript-eslint/ban-types": "off", // 35 errors
"@typescript-eslint/explicit-module-boundary-types": "off", // 1242 warnings
"@typescript-eslint/no-empty-interface": "off", // 45 errors
"@typescript-eslint/no-explicit-any": "off", // 535 warnings
"@typescript-eslint/no-namespace": "off", // 1 error
"@typescript-eslint/no-this-alias": "off", // 4 errors
"@typescript-eslint/triple-slash-reference": "off", // 1 error
"no-misleading-character-class": "off", // 2 errors
"no-prototype-builtins": "off", // 8 errors
"no-self-assign": "off", // 2 errors
"no-useless-escape": "off", // 24 errors
"prefer-spread": "off", // 7 errors
"react-hooks/exhaustive-deps": "off", // 41 errors
//==============================================================
"@typescript-eslint/adjacent-overload-signatures": "error",
"@typescript-eslint/consistent-type-assertions": "error",
"@typescript-eslint/member-delimiter-style": "error",
"@typescript-eslint/no-floating-promises": "error",
"@typescript-eslint/no-inferrable-types": [
"error",
{
ignoreParameters: true,
ignoreProperties: true,
},
],
"@typescript-eslint/no-unused-vars": [
"error",
{
varsIgnorePattern: "^_[a-zA-Z_]",
argsIgnorePattern: "^_[a-zA-Z_]",
},
],
"@typescript-eslint/no-var-requires": "error",
"@typescript-eslint/prefer-namespace-keyword": "error",
"@typescript-eslint/semi": "error",
"@typescript-eslint/type-annotation-spacing": "error",
"computed-property-spacing": ["error", "never"],
curly: "error",
"eol-last": "error",
eqeqeq: ["error", "smart"],
"id-denylist": [
"error",
"any",
"Number",
"number",
"String",
"string",
"Boolean",
"boolean",
"Undefined",
"undefined",
],
"id-match": "error",
"jsdoc/check-alignment": "error",
"jsdoc/require-asterisk-prefix": "error",
"linebreak-style": ["error", "unix"],
"no-caller": "error",
"no-cond-assign": "error",
"no-debugger": "error",
"no-eval": "error",
"no-fallthrough": [
"error",
{
commentPattern: "break[\\s\\w]*omitted",
},
],
// Using the typescript-eslint version of this rule because of class
// properties, which are not yet supported in ESLint. For more info,
// see: https://github.com/typescript-eslint/typescript-eslint/issues/491
"@typescript-eslint/no-invalid-this": "error",
"no-multiple-empty-lines": [
"error",
{
max: 3,
},
],
"no-new-wrappers": "error",
"no-tabs": "error",
"no-trailing-spaces": "error",
"no-undef-init": "error",
"no-unsafe-finally": "error",
"no-unused-labels": "error",
"no-var": "error",
"one-var": ["error", "never"],
"prefer-arrow-callback": ["error", { allowNamedFunctions: true }],
"prettier/prettier": "error",
"use-isnan": "error",
"@typescript-eslint/tslint/config": [
"error",
{
rules: {
"file-header": [true, "[Cc]opyright ([(][Cc][)])?\\s*[Oo]nline-[gG]o.com"],
"import-spacing": true,
whitespace: [
true,
"check-branch",
"check-decl",
"check-operator",
"check-separator",
],
},
},
],
"react-hooks/rules-of-hooks": "error",
"prefer-const": [
"error",
{
destructuring: "all",
},
],
},
overrides: [
{
files: ["*.test.ts", "*.test.tsx"],
// since test files are not part of tsconfig.json,
// parserOptions.project must be unset
parserOptions: {
project: null,
},
rules: {
// rules that depend on type information (and therefore
// parserOptions.project)
"@typescript-eslint/no-floating-promises": "off",
"@typescript-eslint/tslint/config": "off",
},
},
],
};