-
Notifications
You must be signed in to change notification settings - Fork 12.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve readability of default exports #7407
Comments
I'm not 100% clear on what's being reported. I've added |
@RyanCavanaugh More an improvement than a bug fix... For example, the compiler allows me to reference Foo on However the transpiled code uses Foo before What I'm asking is, since the compiler is already capable of recognizing Foo ahead of time, it should also declare |
this looks like a duplicate of #4101 |
Indeed @mhegazy, thank you! |
I'm unable to
export default
modules/namespaces like this:Not sure if its related to #3792, but that isn't actually my issue...
Since I can't
export default
the namespace directly, I would like to convention that default exports should be placed in a separate statement and always put in the first lines of the file:IMO it would improve readability and make it easier to understand how to consume that file/module.
Despite the fact that the compiler seems to understand that I'm exporting the
Utils
namespace, the transpiled code does not associate the export statement and my internal module, causing the default export to be undefined at run time.Would be nice to get
export default
transpiled to the of the file or declare the module container earlier, so I can export it wherever I want.If #3792 gets fixed I can just convention that the default module should always come first, and keep my default export always on sight. So this is issue is more like a suggestion I suppose...
Typescript Version 1.9.0-dev.20160220
The text was updated successfully, but these errors were encountered: