Comments (10)
Prettier is use as dev dependency at the moment. That's a new feature that can be added but should be config in the orval config file. Also could be good to try to find a prettier config in the project and not only apply a custom config.
from orval.
yep, it's a bug need to find a better solution for this
from orval.
Have some concerns about using hardcoded config instead of flexible user config. But as a default option - definitly.
p.s. @anymaniax, btw have you checked https://openapi.tools ? Orval deserves to be in the list.
from orval.
@Boorj I didn't know about https://openapi.tools could be interesting to add Orval there
from orval.
@Boorj We should only use the hardcoded config when we cannot find the user config in its own project. And what I meant is to add a property in the orval config to activate prettier or override the config found or the default one.
from orval.
I am having trouble with this feature. I have Orval and Prettier in my devDependencies
"orval": "^6.5.3",
"prettier": "^2.5.1",
When I run npm run codegen
i get this output..
🎉 authorization - Your OpenAPI spec has been converted into ready to use orval!
from orval.
Probably because with this code it's only using the global installed prettier
from orval.
hmmm i dont have prettier installed globally.
from orval.
You can run prettier on pre-commit
hook. Probably another solution could be to add prettier as a peer dependency.
Also, I made a pull request #459 where you can run a script (prettier, lint, etc...) when client is generated by orval
.
from orval.
This is easy too..
"scripts": {
"format": "prettier --write \"{src,__tests__}/**/*.{ts,tsx}\"",
"codegen": "orval && npm run format",
"start": "react-app-rewired start"
from orval.
Related Issues (20)
- Undefined typing of parameters in generated function
- Add support to use Biome in addition to Prettier HOT 12
- Zod: Components override not working HOT 1
- [Hono] Generated handler cannot be implemeted (`Argument of type 'string' is not assignable to parameter of type 'never'`) HOT 8
- [Hono] repsonse validator generated when there is no response HOT 1
- Zod: Support for OpenApi spec 3.1.0 HOT 2
- SWR client how to get response headers
- Discriminators are not taken into consideration when inlined in response HOT 3
- React Query: Support passing `query.meta` / `mutation.meta` options to axios instance HOT 1
- Feature request: Split polymorphic mocks into it's own functions
- Build setting allParamsOptional is not working as expected HOT 3
- swr: Mutation fetchers are not strongly typed
- OpenAPI: Support for `const` values in string parameter types HOT 4
- Zod: add to @orval/zod support of anyOf/allOf/oneOf in requestBody
- MSW: overrideResponse can be a function HOT 2
- Feature Request: create factory method for instantiating OpenAPI models HOT 2
- ERR_UNSUPPORTED_ESM_URL_SCHEME when using transformer on Windows HOT 3
- faker override to much for nested object HOT 1
- Query options for an operation have no effect
- RangeError when generating mocks HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from orval.