Skip to content

Commit b217859

Browse files
committed
Fix lint and build errors.
1 parent bfcc334 commit b217859

File tree

4 files changed

+16
-16
lines changed

4 files changed

+16
-16
lines changed

packages/custom-elements/ts_src/CustomElementInternals.ts

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -280,8 +280,8 @@ export default class CustomElementInternals {
280280
if (definition) {
281281
this._upgradeAnElement(element, definition);
282282
}
283-
} catch (e: any) {
284-
this.reportTheException(e);
283+
} catch (e: unknown) {
284+
this.reportTheException(e as Error);
285285
}
286286
}
287287

@@ -340,8 +340,8 @@ export default class CustomElementInternals {
340340
if (definition.connectedCallback) {
341341
try {
342342
definition.connectedCallback.call(element);
343-
} catch (e: any) {
344-
this.reportTheException(e);
343+
} catch (e: unknown) {
344+
this.reportTheException(e as Error);
345345
}
346346
}
347347
}
@@ -351,8 +351,8 @@ export default class CustomElementInternals {
351351
if (definition.disconnectedCallback) {
352352
try {
353353
definition.disconnectedCallback.call(element);
354-
} catch (e: any) {
355-
this.reportTheException(e);
354+
} catch (e: unknown) {
355+
this.reportTheException(e as Error);
356356
}
357357
}
358358
}
@@ -377,8 +377,8 @@ export default class CustomElementInternals {
377377
newValue,
378378
namespace
379379
);
380-
} catch (e: any) {
381-
this.reportTheException(e);
380+
} catch (e: unknown) {
381+
this.reportTheException(e as Error);
382382
}
383383
}
384384
}
@@ -413,7 +413,7 @@ export default class CustomElementInternals {
413413
return;
414414
}
415415

416-
return (registry as any as CustomElementRegistry).internal_localNameToDefinition(
416+
return ((registry as unknown) as CustomElementRegistry).internal_localNameToDefinition(
417417
localName
418418
);
419419
}
@@ -436,7 +436,7 @@ export default class CustomElementInternals {
436436
// Only create custom elements if the document is associated with a
437437
// registry.
438438
if (registry && (namespace === null || namespace === NS_HTML)) {
439-
const definition = (registry as any as CustomElementRegistry).internal_localNameToDefinition(
439+
const definition = ((registry as unknown) as CustomElementRegistry).internal_localNameToDefinition(
440440
localName
441441
);
442442
if (definition) {
@@ -507,8 +507,8 @@ export default class CustomElementInternals {
507507
}
508508

509509
return result;
510-
} catch (e: any) {
511-
this.reportTheException(e);
510+
} catch (e: unknown) {
511+
this.reportTheException(e as Error);
512512

513513
// When construction fails, a new HTMLUnknownElement is produced.
514514
// However, there's no direct way to create one, so we create a

packages/custom-elements/ts_src/CustomElementRegistry.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -335,8 +335,8 @@ export default class CustomElementRegistry {
335335
this._localNameToConstructorGetter.delete(localName);
336336
try {
337337
return this.internal_reifyDefinition(localName, constructorGetter());
338-
} catch (e: any) {
339-
this._internals.reportTheException(e);
338+
} catch (e: unknown) {
339+
this._internals.reportTheException(e as Error);
340340
}
341341
}
342342

packages/custom-elements/ts_src/Patch/HTMLElement.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ export default function (internals: CustomElementInternals) {
2525

2626
// Always look up the definition from the global registry.
2727
const registry = document.__CE_registry!;
28-
const definition = (registry as any as CustomElementRegistry).internal_constructorToDefinition(
28+
const definition = ((registry as unknown) as CustomElementRegistry).internal_constructorToDefinition(
2929
constructor
3030
);
3131
if (!definition) {

packages/custom-elements/ts_src/custom-elements.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ function installPolyfill() {
4343
const customElements = new CustomElementRegistry(internals);
4444

4545
// The main document is associated with the global registry.
46-
document.__CE_registry = customElements as any;
46+
document.__CE_registry = (customElements as unknown) as CustomElementRegistry;
4747

4848
Object.defineProperty(window, 'customElements', {
4949
configurable: true,

0 commit comments

Comments
 (0)