flow icon indicating copy to clipboard operation
flow copied to clipboard

importing css files throws no kind of error

Open aryzing opened this issue 7 years ago • 6 comments

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

aryzing avatar Jan 11 '19 23:01 aryzing

You're right, this is a bug. Thanks for reporting!

vicapow avatar Feb 11 '19 18:02 vicapow

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?

vicapow avatar Feb 19 '19 00:02 vicapow

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?

aryzing avatar Feb 19 '19 08:02 aryzing

Expected behavior

SamChou19815 avatar Oct 11 '23 15:10 SamChou19815

Did you end up documenting this expected behavior?

aryzing avatar Oct 11 '23 18:10 aryzing

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.

SamChou19815 avatar Oct 12 '23 15:10 SamChou19815