pFad - Phone/Frame/Anonymizer/Declutterfier! Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

URL: http://github.com/fabien0102/openapi-codegen/pull/323

ests-5f61a10d0c5fd0c3.css" /> feat: optionally format files by teovillanueva · Pull Request #323 · fabien0102/openapi-codegen · GitHub
Skip to content

feat: optionally format files - #323

Open
teovillanueva wants to merge 1 commit into
fabien0102:mainfrom
teovillanueva:main
Open

feat: optionally format files#323
teovillanueva wants to merge 1 commit into
fabien0102:mainfrom
teovillanueva:main

Conversation

@teovillanueva

Copy link
Copy Markdown

Add the possibility to disable output formatting. The motivations to add this configuration are the following:

  • Codegen output is not usually commited to git and some projects use other formatting tools (ex. biomejs)
  • The following error I couldn't fix 🤣
Syntax Error: Unexpected token, expected "," (10:10)
   8 |      * @example Invalid request parameters
   9 |      */
> 10 |     error?: string;
     |          ^
  11 |     /**
  12 |      * @example 400
  13 |      */
   8 |      * @example Invalid request parameters
   9 |      */
> 10 |     error?: string;
     |          ^
  11 |     /**
  12 |      * @example 400
  13 |      */
    at pa (file://github.com/Users/teovillanueva/Desktop/typend/node_modules/.pnpm/[email protected]/node_modules/prettier/plugins/babel.mjs:14:16245)
    at ua (file://github.com/Users/teovillanueva/Desktop/typend/node_modules/.pnpm/[email protected]/node_modules/prettier/plugins/babel.mjs:14:16680)
    at Object.parse (file://github.com/Users/teovillanueva/Desktop/typend/node_modules/.pnpm/[email protected]/node_modules/prettier/plugins/babel.mjs:15:2919)
    at parse5 (file://github.com/Users/teovillanueva/Desktop/typend/node_modules/.pnpm/[email protected]/node_modules/prettier/index.mjs:16731:24)
    at async coreFormat (file://github.com/Users/teovillanueva/Desktop/typend/node_modules/.pnpm/[email protected]/node_modules/prettier/index.mjs:17287:25)
    at async formatWithCursor (file://github.com/Users/teovillanueva/Desktop/typend/node_modules/.pnpm/[email protected]/node_modules/prettier/index.mjs:17504:14)
    at async Object.format2 (file://github.com/Users/teovillanueva/Desktop/typend/node_modules/.pnpm/[email protected]/node_modules/prettier/index.mjs:19051:25)
    at async Object.writeFile2 [as writeFile] (file://github.com/Users/teovillanueva/Desktop/typend/node_modules/.pnpm/@[email protected]/node_modules/@openapi-codegen/cli/lib/cli.js:380:35)
    at async generateSchemaTypes (/Users/teovillanueva/Desktop/typend/node_modules/.pnpm/@[email protected]/node_modules/@openapi-codegen/typescript/lib/generators/generateSchemaTypes.js:97:13)
    at async Object.to (file://github.com/Users/teovillanueva/Desktop/typend/packages/api-hooks/openapi-codegen.config.mjs:12:38)

@fabien0102

Copy link
Copy Markdown
Owner

Thanks for the contribution, but I think we can go further, let’s remove prettier from the pipeline. The latest version (this one is not up-to-date) has some problems to grab the proper config and it’s easy enough to add prettier as second step command.

I did a simple guide for my other project that you can take inspiration -> https://github.com/fabien0102/ts-to-zod?tab=readme-ov-file#prettifying-the-generated-files, I think it’s nice to help people that still want this feature

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

pFad - Phonifier reborn

Pfad - The Proxy pFad © 2024 Your Company Name. All rights reserved.





Check this box to remove all script contents from the fetched content.



Check this box to remove all images from the fetched content.


Check this box to remove all CSS styles from the fetched content.


Check this box to keep images inefficiently compressed and original size.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy