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

Typescript warnings about exports not found #41113

Closed
sirbrillig opened this issue Apr 14, 2020 · 6 comments · Fixed by #41285
Closed

Typescript warnings about exports not found #41113

sirbrillig opened this issue Apr 14, 2020 · 6 comments · Fixed by #41285

Comments

@sirbrillig
Copy link
Member

sirbrillig commented Apr 14, 2020

When starting Calypso, I get a ton of warnings like this that appear in the console:

WARNING in ./my-sites/checkout/composite-checkout/wpcom/types.ts 9:0-1022
"export 'WpcomStoreState' was not found in './types/wpcom-store-state'

It's weird because that type (and all the others mentioned) definitely exists. This doesn't appear to affect the actual running of code.

@sirbrillig
Copy link
Member Author

sirbrillig commented Apr 14, 2020

I think it might be isolatedModules: webpack/webpack#7378 (comment)

Basically, when re-exporting types, you have to use export type and import type to comply with the rules of Typescript 3.8 (which we are using in Calypso).

However, doing so causes Prettier to throw an error because export type is not recognized until prettier 2.0.

So I think that right now we just have to have one error or another.

@ockham
Copy link
Contributor

ockham commented Apr 15, 2020

I think @sgomes is on this, see #41100.

@sgomes
Copy link
Contributor

sgomes commented Apr 15, 2020

@ockham I am indeed. I had to close that PR to fix some @wordpress/* issues first (see #41141), but once that's sorted I'll go back to trying to update Babel.

@sirreal
Copy link
Member

sirreal commented Apr 15, 2020

#41114 is upgrading to wp-prettier@2.

@sgomes
Copy link
Contributor

sgomes commented Apr 16, 2020

The new Babel upgrade PR is at #41175.
This has now been merged.

@sgomes
Copy link
Contributor

sgomes commented Apr 20, 2020

We may need some updates to eslint-plugin-import as well, so that import type { Foo } from './foo'; and import { makeFoo } from './foo'; can coexist in the same file without claiming there's a duplicate import.

Edit: See import-js/eslint-plugin-import#1667

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants