-
-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Open
Labels
Description
Describe the bug
The script part of AST specifically imports are missing importKind type
Reproduction
import { parse } from 'svelte/compiler';
const ast = parse(`
<script lang="ts">
import type { Snippet } from 'svelte'
import { mount } from 'svelte'
</script>
`, { modern: true })
// narrow down type to import declarations
if (ast.instance?.content.body[0].type === 'ImportDeclaration') {
// this gives error // Property 'importKind' does not exist on type 'ImportDeclaration'.
ast.instance?.content.body[0].importKind
// But if we log it we can see it dose have them
console.log(ast.instance?.content.body[0].importKind) // type
console.log(ast.instance?.content.body[1].importKind) // value
}Logs
No response
System Info
Not importantSeverity
annoyance