fix: support TS type assertions (#15642)

fixes #15565
pull/15647/head
Simon H 6 months ago committed by GitHub
parent 04257925d2
commit 6f8068637c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -0,0 +1,5 @@
---
'svelte': patch
---
fix: support TS type assertions

@ -94,6 +94,9 @@ const visitors = {
TSTypeAliasDeclaration() {
return b.empty;
},
TSTypeAssertion(node, context) {
return context.visit(node.expression);
},
TSEnumDeclaration(node) {
e.typescript_invalid_feature(node, 'enums');
},

@ -45,6 +45,7 @@
export type { Hello };
const TypedFoo = Foo<true>;
const typeAssertion = <boolean>true;
</script>
<script>

Loading…
Cancel
Save