Skip to content

Commit

Permalink
chore: TS fixes cleanup (#14750)
Browse files Browse the repository at this point in the history
* chore: TS fixes cleanup

- move a test
- revert seemginly unnecessary code changes

* add another test
  • Loading branch information
dummdidumm authored Dec 18, 2024
1 parent 2bfdd1b commit 88a15cd
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 23 deletions.
10 changes: 1 addition & 9 deletions packages/svelte/src/compiler/phases/2-analyze/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -698,16 +698,8 @@ export function analyze_component(root, source, options) {
}

for (const node of analysis.module.ast.body) {
if (
node.type === 'ExportNamedDeclaration' &&
// @ts-expect-error
node.exportKind !== 'type' &&
node.specifiers !== null &&
node.source == null
) {
if (node.type === 'ExportNamedDeclaration' && node.specifiers !== null && node.source == null) {
for (const specifier of node.specifiers) {
// @ts-expect-error
if (specifier.exportKind === 'type') continue;
if (specifier.local.type !== 'Identifier') continue;

const binding = analysis.module.scope.get(specifier.local.name);
Expand Down
6 changes: 0 additions & 6 deletions packages/svelte/src/compiler/phases/scope.js
Original file line number Diff line number Diff line change
Expand Up @@ -433,13 +433,7 @@ export function create_scopes(ast, root, allow_reactive_declarations, parent) {
},

ImportDeclaration(node, { state }) {
// @ts-expect-error
if (node.importKind === 'type') return;

for (const specifier of node.specifiers) {
// @ts-expect-error
if (specifier.importKind === 'type') continue;

state.scope.declare(specifier.local, 'normal', 'import', node);
}
},
Expand Down

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@
console.log(this);
}
function foo(): string {
return ""!;
}
class Foo<T> {
public name: string;
x = 'x' as const;
Expand All @@ -16,6 +20,8 @@
}
}
class MyClass implements Hello {}
declare const declared_const: number;
declare function declared_fn(): void;
declare class declared_class {
Expand Down

0 comments on commit 88a15cd

Please sign in to comment.