-
Notifications
You must be signed in to change notification settings - Fork 377
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
Get result without export #492
Comments
Can you expand on your use case a little more? It's generally an anti-pattern to use globals (values or types), and better to import types explicitly when you need them. Auto-import in VSCode also works fine with exported types. |
Hi @bcherny, I have a use case about it. Assume we have below strcutrure:
I have two JSON Schema files, and they are independent but refer a shared common JSON schema. export * from './types/a';
export * from './types/b'; There are a TS errors show to tell me the common type is duplicated. So I want to have the disable adding export feature. |
I would love to have this as well. I'm using this library to generate types for a larger codegen purpose, where the types will be exposed as a generic parameter to a class instance that is exported. I don't need (or want) these types exported because they clutter up autocomplete in the IDE. Right now I'm just using regex to remove the e.g.: type GeneratedFromSchema = {
prop: string;
};
export const classInstance = new Class<GeneratedFromSchema>(); |
I'm generating types based on the api's schema which works. However the results contains a lot of
export
which forces me to explicitly import the generated types.Since it's a Nuxt project (which comes with a nice auto-import feature) I'd like to have the generated types available without explicitly importing them. I've found an old issue that which relates to this topic though was (unfortunately) solved differently: #202
@bcherny it would be great to have an option to disable adding
export
The text was updated successfully, but these errors were encountered: