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'd propose another new option('-s, --typescript', 'Generate TypeScript code.') for generating more strict typed mocks. If it is a good idea, I'd like to help get a PR done as well.
The text was updated successfully, but these errors were encountered:
I'm not sure if I agree here. Don't get me wrong, I love TypeScript. But generated files should probably rather get ignored instead of linted (or formatted). Every user has a different lint configuration and there will probably always be a rule that is too strict for the generated file. I think it's not reasonable, or even possible, to write the output file in a way that every possible linting rule is happy. Maybe consider ignoring the generated files in your eslint config, instead.
The types of the internal structure can be any but I think the exported members should have types, just to solve the complaints when using them without having to ignore errors.
For example in our organization we have a ver simple handlers.d.ts
For our organization use case, we usually generate the mocks by running
npx msw-auto-mock ./swagger.json -o ./src/generated/mock.ts --base-url ${BASE_URL} --codes 200,201,204
If we don't ingnore eslint for this file, we always end up with the following complaint.
I'd propose another new
option('-s, --typescript', 'Generate TypeScript code.')
for generating more strict typed mocks. If it is a good idea, I'd like to help get a PR done as well.The text was updated successfully, but these errors were encountered: