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

refactor: remove all unnecessary @ts-ignore annotations #2441

Merged
merged 3 commits into from
Mar 2, 2021

Conversation

michaelfig
Copy link
Member

@michaelfig michaelfig commented Feb 16, 2021

Either updates to the Typescript version we use in agoric-sdk, or cargo-culting means many of our @ts-ignore annotations are unnecessary.

I suggest that we should avoid @ts-ignore whenever we can: only use it when Typescript really has a bug we can't work around, such as #2438 (comment). Then, link to the corresponding open issue on the TypeScript repository in the same line as @ts-ignore.

@michaelfig michaelfig added the hygiene Tidying up around the house label Feb 16, 2021
@michaelfig michaelfig self-assigned this Feb 16, 2021
@michaelfig michaelfig force-pushed the mfig-excise-ts-ignore branch 3 times, most recently from 0af0d75 to 5ad04cb Compare February 16, 2021 19:22
@katelynsills
Copy link
Contributor

The @ts-ignore annotations aren't cargo-culting. I put them there on purpose. In my local settings, I have type checking on by default (even without ts-check) and it is helpful to me to be able to type check the tests, and where the types are intentionally wrong in the tests (normally a t.throws test), to suppress that error. As it's not hurting anyone, and it's my preference, I would like to leave these as they are.

Copy link
Contributor

@katelynsills katelynsills left a comment

Choose a reason for hiding this comment

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

Please keep the @ts-ignore above t.throws and t.throwsAsync

Copy link
Member

@dckc dckc left a comment

Choose a reason for hiding this comment

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

I'd like to understand better why some of these are no longer necessary. Not critical.

I'm not sure about the Zoe stuff. I guess I'll stand by for Kate's comments... but that doesn't seem like an algorithm that terminates. Splitting the PR would make for a more clear process, but maybe that's more trouble than it's worth.

packages/marshal/src/marshal.js Show resolved Hide resolved
@@ -1,4 +1,3 @@
// @ts-ignore
Copy link
Member

Choose a reason for hiding this comment

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

I don't understand why this is no longer necessary. hm.

@michaelfig
Copy link
Member Author

The @ts-ignore annotations aren't cargo-culting. I put them there on purpose. In my local settings, I have type checking on by default (even without ts-check) and it is helpful to me to be able to type check the tests, and where the types are intentionally wrong in the tests (normally a t.throws test), to suppress that error. As it's not hurting anyone, and it's my preference, I would like to leave these as they are.

Sorry, I had assumed those files were running with @ts-check so when I removed the @ts-ignore I didn't see any effect.
I will revert those changes.

Would you like me to add @ts-check to them?

@katelynsills
Copy link
Contributor

Sorry, I had assumed those files were running with @ts-check so when I removed the @ts-ignore I didn't see any effect.
I will revert those changes.

Would you like me to add @ts-check to them?

That would be great, thanks!

@michaelfig
Copy link
Member Author

@katelynsills would you be able to take a look at the documentation snippets failure at: https://github.com/Agoric/agoric-sdk/pull/2441/checks?check_run_id=1913294837#step:12:10

Thanks!

@katelynsills
Copy link
Contributor

@katelynsills would you be able to take a look at the documentation snippets failure at: https://github.com/Agoric/agoric-sdk/pull/2441/checks?check_run_id=1913294837#step:12:10

Thanks!

Yup!

Copy link
Contributor

@katelynsills katelynsills left a comment

Choose a reason for hiding this comment

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

LGTM! Thanks for doing this cleanup

@katelynsills
Copy link
Contributor

Is this waiting on something? The documentation checks are passing 👍

@michaelfig michaelfig force-pushed the mfig-excise-ts-ignore branch from 0fd4cd7 to 10afb9c Compare March 2, 2021 02:02
@michaelfig
Copy link
Member Author

Is this waiting on something? The documentation checks are passing 👍

Not waiting on anything now! Thanks for the prod.

@michaelfig michaelfig enabled auto-merge March 2, 2021 02:03
@michaelfig michaelfig merged commit c5ee847 into master Mar 2, 2021
@michaelfig michaelfig deleted the mfig-excise-ts-ignore branch March 2, 2021 02:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
hygiene Tidying up around the house
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants