-
Notifications
You must be signed in to change notification settings - Fork 1.4k
feat: add ability to preserve ts file extension #10491
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
Conversation
|
|
Should I add the changeset too? |
|
Hi @nickmessing, This way, it's up to the user to configure it for their environment. Otherwise, we'd keep adding booleans and they may override each other |
|
Sure, I could do that, but we need a bit better planning for that as What about: interface ConfigOptions {
outputFileExtension: '.ts' | '.mts' | '.cts', // default: '.ts'
importExtension: 'omit' | 'preserve' | 'js-compatible', // default: 'omit'
}
P.S. I would prefer "preserve" for default wdyt @eddeee888 |
|
Hi @nickmessing , outputFileExtension:
| '' // no extension
| '.ts'
| '.js'
| '.mts'
| '.mjs'
| '.cts'
| '.cjs' |
|
If it's configured as |
|
I'll close this PR, let's discuss in #10490 |
Description
Add
preserveTSExtensionboolean configuration that allows.tsfile extensions (for native import without transpilation tools)Related #10490
Prerequisite for eddeee888/graphql-code-generator-plugins#364
Type of change
Please delete options that are not relevant.
How Has This Been Tested?
Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration
.tsextension when flag is presentTest Environment:
@graphql-codegen/cli: latestChecklist: