You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I use this library all the time. Thank you very much.
I would like to be able to specify singleQuote, etc. directly to SwaggerToTSOptions.
Currently, SwaggerToTSOptions has a prettierConfig, which can specify the path to the prettier configuration file.
However, I recently switched formatters from prettier to rome and removed prettierrc(as prettierConfig) from the project.
As a result, I can no longer specify singleQuote, etc. in prettierrc when generating type files with openapi-typescript.
I would like to get your opinion on this, as I am sure there are many people like me who have switched from prettier to rome.
On the other hand, I would like to know if there is a work-around for this kind of singleQuote generation in the current functionality.
Best regards!
The text was updated successfully, but these errors were encountered:
Well, I have bad news for you—openapiTS does ship Prettier as one of its dependencies, so as of now, you’ll still have to use the prettierrc config file to customize the formatting.
I can see 2 possible additions that would be welcome to this library, but I’d need someone to open the PR:
Allow prettier options in the Node.js API: this is the simplest solution. I’m not opposed to this. But only reason it wasn’t added initially was because Prettier still relies on filesystem config files for a lot of options and plugin loading, and so this felt like a mini-rabbit hole that would be a little bit of work.
Allow the formatter to be swappable. Rome is pretty cool! I’ve experimented with it, and I’m not quite ready to switch projects over to it but I’d love to when it’s more stable. But there may be a way to make openAPI’s formatter more pluggable/swappable, which would also necessitate more inline config options as a default.
Last thought: I’ve always tried to keep this library as lightweight and dependency-free as possible, but a formatter just seemed like a required part because code generation almost always needs formatting, and Prettier is still (love it or hate it) the most widely-used option. But I’m not married to anything, so long as people can customize their output however they want.
So update: unless this changes before the v6 release, this library won’t ship any formatter at all! So feature granted…kinda? Overall you raised some good points—formatting is outside the concern for this library, and should be managed by the user. Which will also be good news that this no longer ships Prettier, so that won’t be in projects that aren’t using it anyway.
I use this library all the time. Thank you very much.
I would like to be able to specify singleQuote, etc. directly to SwaggerToTSOptions.
Currently, SwaggerToTSOptions has a prettierConfig, which can specify the path to the prettier configuration file.
However, I recently switched formatters from prettier to rome and removed prettierrc(as prettierConfig) from the project.
As a result, I can no longer specify singleQuote, etc. in prettierrc when generating type files with openapi-typescript.
I would like to get your opinion on this, as I am sure there are many people like me who have switched from prettier to rome.
On the other hand, I would like to know if there is a work-around for this kind of singleQuote generation in the current functionality.
Best regards!
The text was updated successfully, but these errors were encountered: