facebook / facebook/flow

Should [ignore] apply to name_mapper aliases?

オープン
#2,973 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る
主要言語
Rust
スター
22.3k
フォーク
1.9k
PR マージ指標
30日以内にマージされた PR はありません

説明

`[ignore]` options affect `name_mapper` aliases too. This seems unusual. For example, I would expect this configuration to allow Flow to check and pass `require('./includes/style.scss')` with no errors.

```
[ignore]
.*/node_modules/.*

[options]
module.name_mapper.extension='scss' -> 'empty/object'
```

`empty` is [the npm package](https://www.npmjs.com/package/empty), installed by `npm install` into `node_modules/`.

This configuration fails with;

```
src/main.js:2
2: require('./includes/style.scss');
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ./includes/style.scss. Required module not found
```

If the ignore rule is removed it passes, but `flow check --all` is slow and fails on the content of `node_modules/`.

E.g https://github.com/BevanR/Flow-type-ignores-aliases-too

How can I include the `empty` npm package for the purpose of name_mapping/aliasing without also type-checking `/node_modules/` or resorting to `// @flow` comments in all of my files (instead of `flow check --all`)?

Is this supported?

コントリビューションガイド

コントリビューションガイドを開く

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。