Closed lukaskoeller closed 2 weeks ago
Start a new pull request in StackBlitz Codeflow.
This will be addressed as part of the parser release. Thank you for reporting!
@lukaskoeller this is fixed in the experimental parser. For more information about it, see the release page https://github.com/hey-api/openapi-ts/releases/tag/%40hey-api%2Fopenapi-ts%400.54.3
Experimental parser is currently opt-in to gather feedback before making it widely available. Please let me know if you run into any issues with it!
Description
Actual
In the
services.gen.ts
there arevoid is only valid as a return type or generic type argument.eslint[@typescript-eslint/no-invalid-void-type](https://typescript-eslint.io/rules/no-invalid-void-type)
errors appearing.Expected
The eslint page suggests to use
undefined
instead.That would mean that these appearances would change as follows:
Reproducible example or configuration
https://stackblitz.com/edit/hey-api-client-fetch-example-nppfy7?file=src%2Fclient%2Fservices.gen.ts
Then run
npm run lint
. Quite some issues will appear, but some will be like:OpenAPI specification (optional)
Any OpenAPI endpoint that does return nothing basically.
System information (optional)
Only thing important to mention here, is a more strict eslint config:
These were added/edited to the base stackblitz example. It is the recommended production setup by the vite react-ts template (see README)