-
Notifications
You must be signed in to change notification settings - Fork 12.8k
Automatically import module #8550
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
Comments
What do you mean exactly by automatically? Is this a language-service related quick-fix? Or is it something the compiler would figure out on its own? |
I mean the compiler |
The compiler can not implicitly figure out your imports. what if you have a global called |
If there any way to avoid importing 10 files at the top of every file? import X from "./X.ts"
import Y from "./Y.ts"
... Or to import a file/library project wide? |
you could reexport declarations.. e.g.: // api.ts
// Things that every one needs
export * from "./x";
export * from "./y";
export * from "./z"; // module.ts
import { x, y, z} from "./api"; |
@mhegazy Thanks for your help. That work around will do. I was hoping for something like swift thought were imports happen automatically for the same project. |
Is there a way to do |
StackOverflow or gitter or ##typescript on IRC are really good places for these types of questions. |
As @kitsonk noted, |
Automatically import modules.
A.ts:
B.ts:
Module B would automatically import module A.
The text was updated successfully, but these errors were encountered: