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

Remove suppression comments #26

Open
meandmax opened this issue Jun 20, 2021 · 4 comments
Open

Remove suppression comments #26

meandmax opened this issue Jun 20, 2021 · 4 comments

Comments

@meandmax
Copy link
Contributor

What do you think about removing all sorts of flow suppression comments? Happy to do it if nothing speaks against it :)

@zxbodya
Copy link
Owner

zxbodya commented Jun 20, 2021

While it is easy to remove, and in many cases it indeed can be removed - often there can be same sort of type error to be ignored in typescript as well…

So decided to better keep it as is to have additional hints when manually fixing remaining types after migration

@meandmax
Copy link
Contributor Author

Interesting :) I believe in our codebase most of the suppression comments are added due to flow and only in rare cases there would be a similar issue in TS. Have you thought about removing them and automatically adding ts suppressions at the end of the conversion? Wit something like: https://github.com/airbnb/ts-migrate/blob/master/packages/ts-migrate-plugins/src/plugins/ts-ignore.ts

@meandmax
Copy link
Contributor Author

May be we could add that functionality behind a cli flag? :)

@zxbodya
Copy link
Owner

zxbodya commented Jun 20, 2021

Indeed, I have similar observation :) But still - in some cases, there is a similar issue with TS, so would it useful.

About having automatic ts-ignores - that is indeed something, I am planing to look into, that would be indeed very helpful to unblock migration in some cases.

However, on its own, I think, it will add more ignores that is actually needed…

And, I am thinking to do it only as part of bigger effort:

  • adding logic to generate tsconfig (both simple case and monorepo with project references)
  • installing missing type definitions
  • trying to fix typical error patterns using type information (for example, one such case I noticed - having functional components returning ReactNode… which is fine in flow but is not for TS)

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