Replies: 2 comments 2 replies
-
As far as I know the types are only stripped during processing/compilation, not analyzed, which is why these explicit instructions are required. (Type checking is done separately via |
Beta Was this translation helpful? Give feedback.
1 reply
-
while we might be able to I don't think it would be a good idea. Being explicit with imports is good for static analysis tools and provides important context when reading a file as a human. Its just 5 chars and should also be automatically generated for imports added by your ide, is this really something you need? Why? |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
For example, the code below can work in Vue
Similar code does not work properly in svelte
A compilation error will appear:
'Add' is a type and must be imported using a type-only import when 'verbatimModuleSyntax' is enabled
, and a runtime error:Uncaught SyntaxError: The requested module '/src/utils.ts' does not provide an export named 'Add'
. Since Vue has already achieved this, shouldn't the Svelte compiler, as a similar template language, be able to do it too?Beta Was this translation helpful? Give feedback.
All reactions