Open aryzing opened 5 years ago
You're right, this is a bug. Thanks for reporting!
I looked into this a bit more and this seems to be working as designed based on https://github.com/facebook/flow/pull/2252
and https://github.com/facebook/flow/commit/14fcdc8424dbea042e388c12fa5ac833959ba0fc
It sounds like you're looking for an additional configuration option to turn off this behavior?
Personally, I'm not a fan because neither of us knew about this, and probably many others will be confused about this too. Also, this behaviour is not documented.
Also why give any non JS asset preferential treatment? As far as I'm aware, flow is not a bundler, and it's not designed to care about anything other than JS, so why bake it in? Is this "convenience" worth it?
Expected behavior
Did you end up documenting this expected behavior?
That's right. I will reopen and document it. On the longer time, we plan to implement something like declare module '*.css' { ... }
so that it's not needed.
Importing .css files throws no kind of error, is this expected behavior, even when setting all the strict options and linting rules to error? Are .css files given special or preferential treatment?
Sample repo