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

Prevent unused types warnings #609

Closed
wants to merge 2 commits into from

Conversation

danielvandenberg95
Copy link

Prevent typescript unused types warnings by prefixing unused types with _.

@danielvandenberg95
Copy link
Author

This may have to happen in more places, these are just the ones I ran into.

Copy link
Owner

@timostamm timostamm left a comment

Choose a reason for hiding this comment

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

Thanks for the PR!

The TypeScript compiler has many options, and sometimes makes breaking changes in minor releases. That's why we have the ts_nocheck option.

So I'm hesitant to make complicated amends in the code generator. Especially since I really want to move away from the TS Compiler API to generate code, and switch to @bufbuild/protoplugin for easier maintenance.

That said, this is not a complicated change in the code generator 🙂

This may have to happen in more places, these are just the ones I ran into.

Could you run your type check against code generated from the proto directory?

@danielvandenberg95
Copy link
Author

Oh, I actually had overlooked that option, because //tslint:disable was already in there and didn't work. As it'll become the default in the next release, to be honest I'd think this commit a bit of a waste. Using that option now, seems a lot better.

(And to be fair, the empty ? "_smth" : "smth" was bugging me a bit... Didn't like this solution all too much...)

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.

2 participants