-
-
Notifications
You must be signed in to change notification settings - Fork 6.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
typescript-fetch: Fix compatibility with noImplicitAny TS rule #4711
Conversation
please run |
done. |
modules/openapi-generator/src/main/resources/typescript-fetch/runtime.mustache
Outdated
Show resolved
Hide resolved
modules/openapi-generator/src/main/resources/typescript-fetch/runtime.mustache
Outdated
Show resolved
Hide resolved
modules/openapi-generator/src/main/resources/typescript-fetch/runtime.mustache
Outdated
Show resolved
Hide resolved
modules/openapi-generator/src/main/resources/typescript-fetch/runtime.mustache
Outdated
Show resolved
Hide resolved
…runtime.mustache Co-Authored-By: Esteban Gehring <esteban.gehring@gmail.com>
…runtime.mustache Co-Authored-By: Esteban Gehring <esteban.gehring@gmail.com>
…runtime.mustache Co-Authored-By: Esteban Gehring <esteban.gehring@gmail.com>
…runtime.mustache Co-Authored-By: Esteban Gehring <esteban.gehring@gmail.com>
please re-generate the samples with |
For some reason |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Why this PR
runtime.ts file generated by typescript-fetch template doesn't meet the needs of Typescript rule "noImplicitAny" that requires that any function should return an object with its type.
With the current version, the user gets a compile error and it's not possible to fix this error by removing the TS rule. In CRA (Create React Apps and react-script) this rule is kind of "hardcoded" in tsconfig.json. The rules are overridden each time a compilation is raised.
How it solve the issue ?
Just by adding the correct return types. It doesn't break anything in the current code, it just ensures that correct types will be returned.