Flow "strict" mode is not applied to the module's index.js (v0.71.0)
- 主要言語
- Rust
- スター
- 22.3k
- フォーク
- 1.9k
- PR マージ指標
- 30日以内にマージされた PR はありません
説明
I usually use this type of project structure:
```
├── index.js
├── my-module
│ ├── index.js
│ ├── my-first-submodule.js
│ └── my-second-submodule.js
```
Where the `my-first-submodule.js` and `my-second-submodule.js` files export several symbols, and usually, they don't have a `default` export. Then, for convenience, I reexport those symbols in `my-module/index.js` like so:
```
export { func1, func2, class1 } from './my-first-submodule';
export { func3, class2, constant1, constant2 } from './my-second-submodule';
```
Since every file is properly type-annotated and has a `// @flow` pragma at the beginning, everything checks fine and there are no errors. But if I change all `// @flow` pragmas to `// @flow strict`, and try to import the module folder (which implicitly imports the `index.js` file inside it), I get errors about all dependencies of a strict module also have to be strict:
```
Dependencies of a @flow strict module must also be @flow strict! (nonstrict-import)
1│ // @flow strict
2│
3│ import { func1 } from './my-module';
```
Changing `import { func1 } from './my-module';` to `import { func1 } from './my-module/index';` does work, though.
I got a [demo repo](https://github.com/mandx/flow-test/tree/09e99380df8f008023746bd1d352f62d9ba7f0e5) demonstrating the issue.
Am I doing something wrong? I did tweaked the `.flowconfig` file (is also included in the demo repo)
コントリビューションガイド
評価
この issue はまだ評価されていません。