tomblachut / svelte-intellij

Svelte components in WebStorm and friends
MIT License
485 stars 38 forks source link

Add import statement as 'import type' for types and interfaces (typescript) #228

Closed Treverix closed 3 years ago

Treverix commented 3 years ago

We can let intellij add a missing import and that also works on svelte source files with lang="ts".

image

The only trouble is: svelte requires that all types and interfaces to be imported as type

import type {SuiteSelectorEvents} from "./types";

while the current plugin adds it like that:

import {SuiteSelectorEvents} from "./types";

That is probably the default behavior of IDEA but it would be great if the plugin could add the import as import type here because otherwise we observe (pretty misleading) compile errors when we miss to fix it immediately.

SelcukKayahan commented 3 years ago

Same here. Already tried this among others: https://youtrack.jetbrains.com/issue/WEB-43269

tomblachut commented 3 years ago

Will be supported in 2021.2 as part of https://youtrack.jetbrains.com/issue/WEB-50851