Skip to content

Commit 88a15cd

Browse files
authored
chore: TS fixes cleanup (#14750)
* chore: TS fixes cleanup - move a test - revert seemginly unnecessary code changes * add another test
1 parent 2bfdd1b commit 88a15cd

File tree

5 files changed

+7
-23
lines changed

5 files changed

+7
-23
lines changed

packages/svelte/src/compiler/phases/2-analyze/index.js

+1-9
Original file line numberDiff line numberDiff line change
@@ -698,16 +698,8 @@ export function analyze_component(root, source, options) {
698698
}
699699

700700
for (const node of analysis.module.ast.body) {
701-
if (
702-
node.type === 'ExportNamedDeclaration' &&
703-
// @ts-expect-error
704-
node.exportKind !== 'type' &&
705-
node.specifiers !== null &&
706-
node.source == null
707-
) {
701+
if (node.type === 'ExportNamedDeclaration' && node.specifiers !== null && node.source == null) {
708702
for (const specifier of node.specifiers) {
709-
// @ts-expect-error
710-
if (specifier.exportKind === 'type') continue;
711703
if (specifier.local.type !== 'Identifier') continue;
712704

713705
const binding = analysis.module.scope.get(specifier.local.name);

packages/svelte/src/compiler/phases/scope.js

-6
Original file line numberDiff line numberDiff line change
@@ -433,13 +433,7 @@ export function create_scopes(ast, root, allow_reactive_declarations, parent) {
433433
},
434434

435435
ImportDeclaration(node, { state }) {
436-
// @ts-expect-error
437-
if (node.importKind === 'type') return;
438-
439436
for (const specifier of node.specifiers) {
440-
// @ts-expect-error
441-
if (specifier.importKind === 'type') continue;
442-
443437
state.scope.declare(specifier.local, 'normal', 'import', node);
444438
}
445439
},

packages/svelte/tests/runtime-browser/samples/typescript-class-and-interface/_config.js

-3
This file was deleted.

packages/svelte/tests/runtime-browser/samples/typescript-class-and-interface/main.svelte

-5
This file was deleted.

packages/svelte/tests/runtime-runes/samples/typescript/main.svelte

+6
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@
88
console.log(this);
99
}
1010
11+
function foo(): string {
12+
return ""!;
13+
}
14+
1115
class Foo<T> {
1216
public name: string;
1317
x = 'x' as const;
@@ -16,6 +20,8 @@
1620
}
1721
}
1822
23+
class MyClass implements Hello {}
24+
1925
declare const declared_const: number;
2026
declare function declared_fn(): void;
2127
declare class declared_class {

0 commit comments

Comments
 (0)