Closed mheob closed 2 years ago
Hi @mheob! thanks for such an elaborate description. Sadly I'm not maintaining this project anymore.
Personally I've moved to native VS Code import sorting in case this is blocking your work.
I'm sure @jerome-benoit would be open for a PR if you're willing to implement it.
Thank you for your prompt reply, @amatiasq!
I will look for an alternative for our team, like the native VS Code integration you described.
I also close the issue at this point. Maybe you can add the label wontfix
to make clear.
@mheob as said, I'm not maintaining this project, that doesn't mean it won't be fixed. It means I'm not available to do it.
TypeScript 4.5 is released.
With this, there are some new features around the imports.
Currently, they are not support by
vsc-sort-imports
and break the code.For Example, some necessary changes from the TypeScript Docs:
type
Modifiers on Import NamesWhen these options are combined, we need a way to signal when an import can be legitimately dropped. TypeScript already has something for this with
import type
:This works, but it would be nice to avoid two import statements for the same module. That’s part of why TypeScript 4.5 allows a
type
modifier on individual named imports so that you can mix and match as needed.In the above example,
BaseType
is always guaranteed to be erased andsomeFunc
will be preserved underpreserveValueImports
, leaving us with the following code:Import Assertions
TypeScript 4.5 supports an ECMAScript proposal for import assertions. This is a syntax used by runtimes to make sure that an import has an expected format.v
The contents of these assertions are not checked by TypeScript since they’re host-specific, and are simply left alone so that browsers and runtimes can handle them (and possibly error).
Dynamic
import()
calls can also use import assertions through a second argument.The expected type of that second argument is defined by a new type called
ImportCallOptions
, and currently only accepts anassert
property.