You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
but TS is clever enough to auto-detect types (as they don't generate any output on the JS), so this
import{TypeName}from'path';// no "type" keyword
should work the same, when TypeName is a type, an interface, a const enum or anything that doesn't generate anything in memory.
In summary, skipTypeImports should work not when there's a import type, but also based on the nature of the imported property as well when there's a basicimport.
The text was updated successfully, but these errors were encountered:
I was checking the code of how detective-typescript works, and saw that it only sees one file at a time without knowing what's importing. That makes a bit hard detecting if an export is a type-like declaration or a real object.
My recommendation so far would be to recursively get into what the imported file is exporting and check their types. Keep a cache of AST objects to avoid parsing the same file multiple times...
This "easy" feature requires a somehow complex solution.
Any thoughts?
This is related to this issue.
Specifying
works only for this kind of code
but TS is clever enough to auto-detect types (as they don't generate any output on the JS), so this
should work the same, when
TypeName
is atype
, aninterface
, aconst enum
or anything that doesn't generate anything in memory.In summary,
skipTypeImports
should work not when there's aimport type
, but also based on the nature of the imported property as well when there's a basicimport
.The text was updated successfully, but these errors were encountered: