facebook / facebook/flow

`import type Foo...` is not semantically equivalent to `import type * as Foo...`

Aperta
#4,197 1 commento 0 reazioni 0 assegnatari Vedi su GitHub
question
Lingua principale
Rust
Stelle
22.3k
Fork
1.9k
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

The changelog announced that `import type * as Foo...` was deprecated in favor of `import type Foo...` way back when (https://github.com/facebook/flow/blob/master/Changelog.md#v0190). [This repo](https://github.com/popham/import_type), however, demonstrates that the use case is broken:

```
consumer.js:5
5: var a: node.a = 1;
^^^^^^ a. Property not found in
exports. See: node.js:0

consumer.js:6
6: var b: node.b = 2;
^^^^^^ b. Property not found in
exports. See: node.js:0

Found 2 errors
```

The documentation doesn't mention the use case and I don't see any tests memorializing it. Is support intended for this use case? (Besides the changelog, I noticed a trace over at https://stackoverflow.com/questions/32602957/how-do-you-export-a-flow-type-definition-that-is-imported-from-another-file#comment-53297391).

Guida per i contributori

Apri la guida per i contributori

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.