Skip to content

Commit ae53eea

Browse files
committed
Fix various linting issues
1 parent cab3a65 commit ae53eea

File tree

36 files changed

+66
-48
lines changed

36 files changed

+66
-48
lines changed

ts/WoltLabSuite/Core/Ajax/Backend.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ class BackendRequest {
9898
let json: unknown;
9999
try {
100100
json = await response.json();
101-
} catch (e) {
101+
} catch {
102102
throw new InvalidJson(response);
103103
}
104104

ts/WoltLabSuite/Core/Ajax/DboAction.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ async function tryParseAsJson(response: Response): Promise<ResponseData> {
217217
let json: ResponseData;
218218
try {
219219
json = await response.json();
220-
} catch (e) {
220+
} catch {
221221
throw new InvalidJson(response);
222222
}
223223

ts/WoltLabSuite/Core/Ajax/Error.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ async function getErrorHtml(error: ApiError): Promise<string | HTMLIFrameElement
6060
let json: ErrorResponse | undefined = undefined;
6161
try {
6262
json = await error.response.clone().json();
63-
} catch (e) {
63+
} catch {
6464
message = await error.response.clone().text();
6565
}
6666

ts/WoltLabSuite/Core/Ajax/Request.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ class AjaxRequest {
235235
if (this.getContentType(xhr) === "application/json") {
236236
try {
237237
data = JSON.parse(xhr.responseText) as ResponseData;
238-
} catch (e) {
238+
} catch {
239239
// invalid JSON
240240
this._failure(xhr, options);
241241

@@ -275,7 +275,7 @@ class AjaxRequest {
275275
let data: ResponseData | null = null;
276276
try {
277277
data = JSON.parse(xhr.responseText);
278-
} catch (e) {
278+
} catch {
279279
// Ignore JSON parsing failure.
280280
}
281281

ts/WoltLabSuite/Core/Bbcode/Code.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ class Code {
115115
const chunkEnd = Math.min(chunkStart + Code.chunkSize, max);
116116

117117
for (let offset = chunkStart; offset < chunkEnd; offset++) {
118-
const toReplace = originalLines[offset]!;
118+
const toReplace = originalLines[offset];
119119
const replacement = highlightedLines.next().value as Element;
120120
toReplace.parentNode!.replaceChild(replacement, toReplace);
121121
}

ts/WoltLabSuite/Core/Component/Comment/List.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ class CommentList {
126126
} catch (error) {
127127
await handleValidationErrors(error, () => {
128128
// The comment id is invalid or there is a mismatch, silently ignore it.
129-
permaLinkComment!.remove();
129+
permaLinkComment.remove();
130130

131131
return true;
132132
});
@@ -195,7 +195,7 @@ class CommentList {
195195
} catch (error) {
196196
await handleValidationErrors(error, () => {
197197
// The response id is invalid or there is a mismatch, silently ignore it.
198-
permalinkResponse!.remove();
198+
permalinkResponse.remove();
199199

200200
return true;
201201
});

ts/WoltLabSuite/Core/Controller/Popover.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -325,8 +325,8 @@ class ControllerPopover implements AjaxCallbackObject {
325325
if (forceHide) {
326326
this.popover.classList.add("forceHide");
327327

328-
// force layout
329-
//noinspection BadExpressionStatementJS
328+
// Query a layout related property to force a reflow, otherwise the transition is optimized away.
329+
// eslint-disable-next-line @typescript-eslint/no-unused-expressions
330330
this.popover.offsetTop;
331331

332332
this.clearContent();

ts/WoltLabSuite/Core/Devtools.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ const Devtools = {
8787
if (settings !== null) {
8888
_settings = JSON.parse(settings);
8989
}
90-
} catch (e) {
90+
} catch {
9191
// Ignore JSON parsing failure.
9292
}
9393

ts/WoltLabSuite/Core/Form/Builder/Field/Checkboxes.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ class Checkboxes extends Field {
2929

3030
return null;
3131
})
32-
.filter((v) => v !== null) as string[];
32+
.filter((v) => v !== null);
3333

3434
return {
3535
[this._fieldId]: values,

ts/WoltLabSuite/Core/Image/ExifUtil.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,11 @@ async function blobToUint8(blob: Blob | File): Promise<Uint8Array> {
5555

5656
reader.addEventListener("error", () => {
5757
reader.abort();
58-
reject(reader.error);
58+
if (reader.error) {
59+
reject(reader.error);
60+
} else {
61+
reject();
62+
}
5963
});
6064

6165
reader.addEventListener("load", () => {

0 commit comments

Comments
 (0)