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
There are 3 files in one folder a.ts, b.ts and c.ts
a.ts
let a = 5, b = 10;
export {a,b};
b.ts
export * from "./a.ts"
c.ts
import {a} from "./b.ts"
then it shows that there is an unused export in b.ts named b even though there is no export named b in b.ts
The text was updated successfully, but these errors were encountered:
demonhue
changed the title
--ignoreLocallyUsed doesn't work with aliases
doesn't work as intended when using export * from "./abc" statement
Jun 26, 2023
You are exporting both a and b from b.ts because of the "*",
1 option:
b.ts was export * as aStuff from "./a.ts"
and c.ts was import { aStuff } from "./b.ts"
2 option:
b.ts was export a from "./a.ts"
and c.ts was import { a } from "./b.ts"
both options should work.
of course in option 2 the error then would say that a.ts has unused b, and in option 1 I image it would work, but you would be hiding that b is unused act.
I have the same issue, and I also notice that the reported location (line number) is wrong. It corresponds to the line number of the original export, not the line number of the export *. This makes it hard/impossible to use a // ts-unused-exports:disable-next-line comment to work around the issue.
I reported the same issue in ts-prunenadeesha/ts-prune#141 and that was never resolved either.
There are 3 files in one folder a.ts, b.ts and c.ts
a.ts
b.ts
c.ts
then it shows that there is an unused export in b.ts named b even though there is no export named b in b.ts
The text was updated successfully, but these errors were encountered: