Update imports & usage for types related to AST nodes.\
I've created two types (namespaces), SvelteAST & ESTreeAST that are used across entire codebase (imported from #parser/ast).
I figured when wrapped into two namespaces is it easier to read and to quickly see from which AST they come from.
This project is unique for using both Svelte AST and ESTree AST, so I hope this clears possible future confusion.
After updating svelte to latest rc version (where AST types from svelte/compiler are finally exposed),
I could see the existing types issues related to previous PR attempts to fix breaking change in Svelte AST
(references: #199 #201). So, I solved them + refactored them a little bit with early returns. There are small logic duplications, but I didn't mind them as they are easier to read and maintain than having very long and complicated if/else statements.
What is not included
There are only warnings left with deprecations related to <svelte:component> and <script context="module">.
I'd rather them being solved them in separate PRs.
To summarize, the main objective - fix CI
check
What has been done
SvelteAST
&ESTreeAST
that are used across entire codebase (imported from#parser/ast
). I figured when wrapped into two namespaces is it easier to read and to quickly see from which AST they come from. This project is unique for using both Svelte AST and ESTree AST, so I hope this clears possible future confusion.svelte
to latest rc version (where AST types fromsvelte/compiler
are finally exposed), I could see the existing types issues related to previous PR attempts to fix breaking change in Svelte AST (references: #199 #201). So, I solved them + refactored them a little bit with early returns. There are small logic duplications, but I didn't mind them as they are easier to read and maintain than having very long and complicated if/else statements.What is not included
There are only warnings left with deprecations related to
<svelte:component>
and<script context="module">
. I'd rather them being solved them in separate PRs.