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
Currently exporting an enum from a .d.ts file and importing/using this enum in a common TS file is allowed. Compilation succeeds but the compiled code will not run since the .d.ts file is not compiled thus the enum values are lost. I would like this to error on compilation.
Use Cases
I just ran into this problem and unfortunately the cause was masked by some other tools resulting in a lot of wasted time.
This falls squarely under the "We believe what you told us" rule. If there isn't a module named ./bar at runtime present with a Status value export, then it is incorrect to write a .d.ts file claiming there is.
Search Terms
Declaration files Definition files .d.ts enums
Suggestion
Currently exporting an enum from a .d.ts file and importing/using this enum in a common TS file is allowed. Compilation succeeds but the compiled code will not run since the .d.ts file is not compiled thus the enum values are lost. I would like this to error on compilation.
Use Cases
I just ran into this problem and unfortunately the cause was masked by some other tools resulting in a lot of wasted time.
Examples
I would like to get something along these lines:
Checklist
My suggestion meets these guidelines:
The text was updated successfully, but these errors were encountered: