Skip to content
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

Merged
merged 9 commits into from
Dec 6, 2019
Merged

typescript-fetch: Fix compatibility with noImplicitAny TS rule #4711

merged 9 commits into from
Dec 6, 2019

Conversation

dngconsulting
Copy link
Contributor

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.

@macjohnny
Copy link
Member

please run bin/typescript-fetch-petstore-all.sh and commit the changed samples

@macjohnny macjohnny changed the title Fix compatibility with noImplicitAny TS rule (required by react-script) typescript-fetch: Fix compatibility with noImplicitAny TS rule (required by react-script) Dec 5, 2019
@macjohnny macjohnny added this to the 4.2.3 milestone Dec 5, 2019
@dngconsulting
Copy link
Contributor Author

dngconsulting commented Dec 5, 2019

done.

@macjohnny macjohnny changed the title typescript-fetch: Fix compatibility with noImplicitAny TS rule (required by react-script) typescript-fetch: Fix compatibility with noImplicitAny TS rule Dec 6, 2019
dngconsulting and others added 4 commits December 6, 2019 10:38
…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>
@macjohnny
Copy link
Member

please re-generate the samples with bin/typescript-fetch-petstore-all.sh

@dngconsulting
Copy link
Contributor Author

For some reason bin/typescript-fetch-petstore-all.sh didn't regenerate all ts files (probably because the diff is the same after trimming). I changed the files manually to remove the extra space so please have a look.

Copy link
Member

@macjohnny macjohnny left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@macjohnny macjohnny merged commit da44e45 into OpenAPITools:master Dec 6, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants