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
Fixes#298
TypeScript is required to remove imports where all bindings are never referenced
in a value position, but previously it could have false positives when there are
shadowed variables with the same name. Now, we do the intelligent scope-based
shadowed global detection like we do with import replacement and properly elide
when necessary.
…#342)
Fixes#298
TypeScript is required to remove imports where all bindings are never referenced
in a value position, but previously it could have false positives when there are
shadowed variables with the same name. Now, we do the intelligent scope-based
shadowed global detection like we do with import replacement and properly elide
when necessary.
This code in the TypeScript transform should NOT import the
./a
module since it's not used (meaning "it's only used as a type" is vacuously true).Instead, Sucrase gives this output:
Playground link
Sucrase should notice that the
a()
usage refers to the shadoweda
declaration and not to the import, and thus not count it as a runtime usage ofa
.The text was updated successfully, but these errors were encountered: