openapi-react-query-codegen icon indicating copy to clipboard operation
openapi-react-query-codegen copied to clipboard

Prettier not run on `api/queries`

Open sschuberth opened this issue 1 year ago • 1 comments

Describe the bug

With --format prettier, no formatting seems to happen for files generated in api/queries.

To Reproduce

Create a .prettierrc with some non-default formatting setting and run with --format prettier.

OpenAPI spec file

n/a

Expected behavior

File in api/queries should get formatted just like the ones in api/requests do.

Screenshots

n/a

  • OS: Linux and Windows
  • Version: v1.3.0

Additional context

The effect can be seen in https://github.com/eclipse-apoapsis/ort-server/pull/224/files.

sschuberth avatar May 15 '24 09:05 sschuberth

@7nohe I am starting to believe we should remove the feature and let the consumers run linting and formatting as duplicating the work of the underlying service generator will be difficult to maintain parity as they do not expose it to other files.

A work around is running the pretter after running the service gen.

seriouslag avatar May 15 '24 14:05 seriouslag

@7nohe I am starting to believe we should remove the feature and let the consumers run linting and formatting as duplicating the work of the underlying service generator will be difficult to maintain parity as they do not expose it to other files.

A work around is running the pretter after running the service gen.

@seriouslag I agree with you. Typically, users do import the output and call functions, but they do not usually modify it. It is best to allow users to make any desired changes after the generation.

7nohe avatar May 18 '24 07:05 7nohe

For the same reason as mentioned here, let's just close this in favor of removing the --format option going forward.

sschuberth avatar May 18 '24 09:05 sschuberth