share type definitions among libs
- Dominant language
- Rust
- Stars
- 22.3k
- Forks
- 1.9k
- PR merge metrics
- No merged PRs in 30d
Description
It seems type definitions cannot share among different lib file. Is this a bug or any other extra configurations are needed?
#### ./flow/dto/ProductDTO.js
```js
// @flow
export type ProductDTO = {
id: number,
name: string,
img: string,
}
export type TestState = {
products: Array,
}
```
#### ./flow/redux/ProductStates.js
```js
// @flow
// I even tried to import type { ProductDTO } from '../dto/ProductDTO';
export type ProductState = {
products: Array,
}
```
#### example.js
```js
// @flow
const Test1: TestState = {
products: ['xxx'], // flow error report here as expected
}
const Test2: ProductState = {
products: ['xxx'], // no error, it seems flow does not recognize ProductState
}
```
#### .flowconfig
...
[libs]
flow
...
Contributor guide
Assessment
This issue has not been assessed yet.