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

Should erasableSyntaxOnly be enabled #2297

Open
cjihrig opened this issue Mar 5, 2025 · 3 comments
Open

Should erasableSyntaxOnly be enabled #2297

cjihrig opened this issue Mar 5, 2025 · 3 comments

Comments

@cjihrig
Copy link
Contributor

cjihrig commented Mar 5, 2025

TypeScript 5.8 added a new compiler option named erasableSyntaxOnly. This option is somewhat of a collaboration with the Node core team as it disallows TypeScript syntax that Node's type stripping does not support.

There are currently 49 errors reported when enabling this option, which is why I'm opening an issue instead of a PR.

If we don't want to work toward enabling it, that's fine, and we can carry on with the status quo. If we do want to enable it, it would lead to a future where we no longer need to transpile for anything except npm publish and running the transpiled tests in the CI.

@brendandburns
Copy link
Contributor

I'll start working on fixing these, seems like a good idea.

@brendandburns
Copy link
Contributor

I started looking into this. Mostly the errors are due to the use of automatic member variables via readonly constructor parameters. Those are easy to fix, though they do make the code a little more verbose.

Some of them are due to the use of enums in the generated code. That's going to require upstream changes in the code generator and a regeneration of the code.

I'll send a PR with all of the local fixes sometime in the next day or two, then work on the upstream generator (unless someone else in the community gets there first)

@brendandburns
Copy link
Contributor

Generator changes are here:
OpenAPITools/openapi-generator#21040

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

No branches or pull requests

2 participants