-
-
Notifications
You must be signed in to change notification settings - Fork 26
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
Generating node/file-extension-in-import
results in a type error
#141
Comments
Okay so this error is caused by https://github.com/bcherny/json-schema-to-typescript generating this invalid type. The old version you show in the diff was a manual modification So I guess I don't feel like going to fork json-schema-to-typescript to fix this bug, I think it would be a bit complicated. ( I'll probably look at it in more detail ). What is on the other hand can be done quite easily, is to implement a patch on our side : |
@Julien-R44 I already exactly thought about the second proposed strategy: implementing a rule-patcher system where you can register some rules with a patched that will be applied on generating. |
Ahah, perfect, I'll do that then 😋 |
@Julien-R44 And because I love your reporter and terminal colors 💚 how about showing e.g. in a yellow-ish color how many were patched while generating 🙂 |
This problem also happens in updated I have encountered this problem while doing #177 and chose to just write a replacer // fix generated object type having incompatible index signature
// and narrow it down to starts-with-dot as per documentation
case 'node/file-extension-in-import': {
this.content = this.content.replace(
`
tryExtensions?: string[];
[k: string]: 'always' | 'never';`,
`
tryExtensions?: string[];
[ext: \`.\${string}\`]: 'always' | 'never';`,
);
break;
} |
This was fixed by #180 |
The text was updated successfully, but these errors were encountered: