-
Notifications
You must be signed in to change notification settings - Fork 9
flowtype-loader doesn't catch type errors in downstream modules #4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
You are correct. This loader was created as POC for flow support in |
Hey @torifat -- any tips on where I can look to not filter out those errors? I'll be happy to send a PR, but I'm not super familiar with the plugin or the webpack API. |
@gabriel-laet Can you help here, please? |
@CodyReichert |
I think I've figured it out, actually. I'll send a PR if I can get confirmation that this is the correct behavior: The errors get filtered out here: Line 53 in 6cd2569
So instead of that, I just removed the
Does that sound right -- seems to throw correct errors for me. |
@torifat - Not a problem - thank you! I posted what I think the solution is above, I'll see if @gabriel-laet has any feedback on that and I'll open a PR. Here's a diff on my fork: CodyReichert@4f20b2b |
@CodyReichert @torifat that makes a lot of sense, I've kept the filter because the original implementation had something similar, but looking at it now we should definitely pass all errors. good job! 👍 |
Take this example:
File
foo.js
File
bar.js
:This type checks. Now if I change
foo.js
to be:webpack recompiles and claims all is well, even though we introduced a type error! Running
flow
on the command line will catch it:Now if we just touch
bar.js
flowtype-loader
will notice the problem too, but not before.It seems that when a file is changed,
flowtype-loader
restricts its typechecking to just that file, ignoring dependent modules where an error may have been introduced by the change. Isflowtype-loader
using some kind of exclusion filter when it runsflow
to restrict scope to the changed file? It seems like since the Flow service is already doing all the work to efficiently recompile everything in an incremental fashion, no such filter is necessary or desirable.The text was updated successfully, but these errors were encountered: