Open mknj opened 3 years ago
👍 Thanks for opening this issue! 🏷 I have applied any labels matching special text in your issue.
The team will review the labels and make any necessary changes.
Anyone have a suggested workaround to this?
add // @ts-nocheck
to the generated files
add
// @ts-nocheck
to the generated files
This is what we use atm, e.g.
SED_COMMAND='1s;^;// @ts-nocheck\n;'
if [ "$(uname)" != "Darwin" ]; then
sed -i "$SED_COMMAND" $TARGET**/*.ts
else
sed -i '' "$SED_COMMAND" $TARGET**/*.ts
fi
I think adding ts-nocheck
is a bit harsh as TypeScript is supposed to add some sort of type safety.
Unfortunately TypeScript does not give us the opportunity to ignore specific errors on class level nor blacklist files during type check.
So I think adding the nocheck option to every generated file should be the solution, too.
So I think adding the nocheck option to every generated file should be the solution, too.
I stand corrected!
If I'm looking at the typescript-axios
generator the TypeScript compilation works fine without errors and without // @ts-nocheck
.
So I added a pull request that is doing the same thing as typescript-axios
already does. And this is to add // @ts-ignore
before the lines there the current compilation errors appear or might appear.
With this change my projects compiled without errors.
Perhaps you'll have a look for yourself and checkout the latest PR.
Do you plan to merge this solution soon?
bump
Time to merge? It's the same solution like typescript-axios already has. So it can't be bad for typescript-axios.
What is taking so long? Merge it already. It's the same solution as done in typescript-axios.
Currently the generator for typescript-fetch is broken for any spec. Nobody with a standard tsconfig can use it without post applying some work around. A possible solution was provided in the error report.
@sdoeringNew, Thanks for https://github.com/OpenAPITools/openapi-generator/pull/11674. Would it be possible to resolve the merge conflicts and fix the failed "ci/circleci: node2" test?
Is there any progress on this? I am waiting for this fix :)
Also have run into this issue and curios about status on this
Is this dead? Hoping it's not.
Bug Report Checklist
Description
typescript-fetch code does not compile because of Errors
openapi-generator version
and "@openapitools/openapi-generator-cli": "^1.0.18-5.0.0-beta2",
OpenAPI declaration file content or url
any file
Generation Details
There are many bugs like
Steps to reproduce
Related issues/PRs
Suggest a fix
replace
/* tslint:disable */
by// @ts-nocheck
or add extra ts-nocheck line