The core functionality is working great. By default however, the imports are inserted at the top line which is incorrect syntax for svelte files. This is because a typical svelte starts like this:
<script>
import foo from 'bar';
</script>
Imports need to start at the second line.
Solutions
(ideal) allow to declare a custom line number in a custom_language object:
Allow insert_at_top to be configurable on a custom_language level. Currently, you would lose insert_at_top functionality for all languages (even ts, js) if you wanted to be compatible with svelte (or vue, html, etc). It's a shame because it's such a convenient feature.
Hi. I'm trying to add
svelte
as a custom language. This is what I have:The core functionality is working great. By default however, the imports are inserted at the top line which is incorrect syntax for svelte files. This is because a typical svelte starts like this:
Imports need to start at the second line.
Solutions
(ideal) allow to declare a custom line number in a custom_language object:
Allow
insert_at_top
to be configurable on acustom_language
level. Currently, you would lose insert_at_top functionality for all languages (even ts, js) if you wanted to be compatible with svelte (or vue, html, etc). It's a shame because it's such a convenient feature.