Skip to content
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

Compatibility with verbatimModuleSyntax tsc option #90

Open
dzialdowski opened this issue Jul 15, 2024 · 1 comment
Open

Compatibility with verbatimModuleSyntax tsc option #90

dzialdowski opened this issue Jul 15, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@dzialdowski
Copy link

Now when using verbatimModuleSyntax we get an error:
'X' is a type and must be imported using a type-only import when 'verbatimModuleSyntax' is enabled

It would be great if we can get an CLI option to import definitions with 'import type' instead of just 'import'

@dderevjanik
Copy link
Owner

dderevjanik commented Jul 15, 2024

Thank you for reporting this issue.

I understand your request regarding the use of import type with verbatimModuleSyntax enabled. However, I believe this might not be the right approach for wsdl-tsclient. As a generator, the primary purpose of wsdl-tsclient is to produce the necessary TypeScript code, without adhering to the specific formatting and linting rules of individual projects.

Consider a scenario where a project requires only type instead of interface, avoids using class, or has specific formatting rules such as spaces instead of tabs. Addressing each of these preferences within the generator could become impractical.

I recommend performing post-processing on the generated code to meet your project's formatting and linting standards. Automated tools can easily adjust the code to use import type instead of import, among other customizations. One effective approach is to create a separate project or library solely for generating the WSDL client, which can then be distributed via a private npm or GitHub repository.

That said, I will consider your suggestion and see if there is a feasible way to incorporate this option into wsdl-tsclient.

Thank you again for your feedback.

@dderevjanik dderevjanik added the enhancement New feature or request label Jul 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants