chore: TS fixes cleanup (#14750)

* chore: TS fixes cleanup

- move a test
- revert seemginly unnecessary code changes

* add another test
pull/14758/head
Simon H 7 days ago committed by GitHub
parent 2bfdd1b436
commit 88a15cd706
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -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);

@ -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);
}
},

@ -1,3 +0,0 @@
import { test } from '../../assert';
export default test({});

@ -1,5 +0,0 @@
<script lang="ts">
// TypeScript syntax should not cause compilation failure
interface MyInterface {}
class MyClass implements MyInterface {}
</script>

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

Loading…
Cancel
Save