Skip to content

Commit 64e4afe

Browse files
refactor: types for client (#5544)
1 parent dd0c284 commit 64e4afe

File tree

7 files changed

+14
-15
lines changed

7 files changed

+14
-15
lines changed

.cspell.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,8 @@
7171
"eslintcache",
7272
"hono",
7373
"privkey",
74-
"geomanist"
74+
"geomanist",
75+
"nodenext"
7576
],
7677
"ignorePaths": [
7778
"CHANGELOG.md",

client-src/index.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
/* global __resourceQuery, __webpack_hash__ */
2-
/// <reference types="webpack/module" />
3-
42
// @ts-expect-error
53
import hotEmitter from "webpack/hot/emitter.js";
64
// @ts-expect-error
@@ -54,10 +52,12 @@ import sendMessage from "./utils/sendMessage.js";
5452
*/
5553
const decodeOverlayOptions = (overlayOptions) => {
5654
if (typeof overlayOptions === "object") {
57-
for (const property_ of ["warnings", "errors", "runtimeErrors"]) {
55+
const requiredOptions = ["warnings", "errors", "runtimeErrors"];
56+
57+
for (let i = 0; i < requiredOptions.length; i++) {
5858
const property =
5959
/** @type {keyof Omit<RawOverlayOptions, "trustedTypesPolicyName">} */
60-
(property_);
60+
(requiredOptions[i]);
6161

6262
if (typeof overlayOptions[property] === "string") {
6363
const overlayFilterFunctionString = decodeURIComponent(

client-src/overlay.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ import ansiHTML from "ansi-html-community";
1010
*/
1111
// @ts-expect-error
1212
const getCodePoint = String.prototype.codePointAt
13-
? (input, position) => input.codePointAt(position)
13+
? // @ts-expect-error
14+
(input, position) => input.codePointAt(position)
1415
: (input, position) =>
1516
(input.charCodeAt(position) - 0xd800) * 0x400 +
1617
input.charCodeAt(position + 1) -

client-src/progress.js

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ export function defineProgressElement() {
2323
this.animationTimer = null;
2424
}
2525

26-
// @ts-expect-error
2726
#reset() {
2827
clearTimeout(this.animationTimer);
2928
this.animationTimer = null;
@@ -44,7 +43,6 @@ export function defineProgressElement() {
4443
this.#update(this.initialProgress);
4544
}
4645

47-
// @ts-expect-error
4846
static #circularTemplate() {
4947
return `
5048
<style>
@@ -111,7 +109,6 @@ export function defineProgressElement() {
111109
`;
112110
}
113111

114-
// @ts-expect-error
115112
static #linearTemplate() {
116113
return `
117114
<style>
@@ -173,7 +170,6 @@ export function defineProgressElement() {
173170
/**
174171
* @param {number} percent percent
175172
*/
176-
// @ts-expect-error
177173
#update(percent) {
178174
const shadowRoot = /** @type {ShadowRoot} */ (this.shadowRoot);
179175
const element =
@@ -201,7 +197,6 @@ export function defineProgressElement() {
201197
}
202198
}
203199

204-
// @ts-expect-error
205200
#show() {
206201
const shadowRoot = /** @type {ShadowRoot} */ (this.shadowRoot);
207202
const element =
@@ -210,7 +205,6 @@ export function defineProgressElement() {
210205
element.classList.remove("hidden");
211206
}
212207

213-
// @ts-expect-error
214208
#hide() {
215209
const shadowRoot = /** @type {ShadowRoot} */ (this.shadowRoot);
216210
const element =

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@
9090
"@types/node": "^24.0.14",
9191
"@types/node-forge": "^1.3.1",
9292
"@types/sockjs-client": "^1.5.1",
93-
"@types/trusted-types": "^2.0.2",
93+
"@types/trusted-types": "^2.0.7",
9494
"acorn": "^8.14.0",
9595
"babel-jest": "^30.0.4",
9696
"babel-loader": "^10.0.0",

tsconfig.client.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
11
{
22
"compilerOptions": {
3-
"target": "es5",
3+
"target": "esnext",
44
"lib": ["es5", "dom", "webworker", "es2022.error"],
5+
"module": "nodenext",
6+
"moduleResolution": "nodenext",
57
"allowJs": true,
68
"checkJs": true,
79
"noEmit": true,
810
"strict": true,
11+
"types": ["@types/trusted-types", "webpack/module"],
912
"skipDefaultLibCheck": true,
1013
"esModuleInterop": true
1114
},

0 commit comments

Comments
 (0)