Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: TS fixes cleanup #14750

Merged
merged 2 commits into from
Dec 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading