hey-api / openapi-ts

✨ Turn your OpenAPI specification into a beautiful TypeScript client
https://heyapi.vercel.app
MIT License
635 stars 44 forks source link

Order of imports #725

Closed mrclrchtr closed 2 days ago

mrclrchtr commented 2 days ago

Description

At first: Thanks for the tool and your effort!

Would it be possible to add ordering of the imports in the services.gen.ts (or all files, but I think the services.gen.ts is the only relevant one)?

In my case, the commit automatically sorts alphabetically and i get diffs whenever i regenerate the client.

Or is that something that should be done with prettier? (I have already tried to implement this, but am currently running into this bug... https://github.com/prettier/prettier-vscode/issues/3380)

mrlubos commented 2 days ago

Hey @mrclrchtr. If you can post process the generated code with Prettier, that's the best way imo. There used to be a feature for indentation and that had the same problem. When you try to infer all the formatter settings, it's easier to just run the actual formatter. Let me know if it becomes unbearably slow to run formatter, it could be revisited then

mrclrchtr commented 2 days ago

Yes, I was expecting that. I will do post processing. Thank you for the answer.