fix: handle TypeScript parameter properties (#11928)

pull/11926/head
Simon H 4 weeks ago committed by GitHub
parent 7714c934fe
commit 8aa8e699ff
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -74,6 +74,9 @@ const visitors = {
TSEnumDeclaration() {
return b.empty;
},
TSParameterProperty(node) {
return node.parameter;
},
Identifier(node) {
if (node.typeAnnotation) {
return {

@ -1,11 +1,17 @@
<script context="module" lang="ts">
interface Hello { message: 'hello' }
interface Hello {
message: 'hello';
}
type Goodbye = { message: 'goodbye' };
function this_fn(this: any) {
console.log(this);
}
class Foo {
constructor(public readonly name: string) {}
}
export type { Hello };
</script>
@ -19,9 +25,9 @@
} satisfies Goodbye;
</script>
<button
on:click={(e: MouseEvent) => {
<button on:click={(e: MouseEvent) => {
const next: number = count + 1;
count = next! as number;
}}
>clicks: {count}</button>
>clicks: {count}</button
>

Loading…
Cancel
Save