-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Not checking node_modules #1548
Comments
No, it is not possible. We are working to improve the current situation with these errors, but for now you have two options: 1) use more granular ignores or 2) ignore all of node modules and declare your dependencies. For (1), something like this might work (I haven't verified the regex syntax, but something along these lines):
The fbjs errors are resolved in the latest alpha, 0.8.0-alpha.3, although that doesn't help you now. This is the first report I've seen for react-motion, so thanks for the heads up. For (2), you can continue to ignore node_modules, but you need to tell Flow about the existence of your modules with libdefs. For example:
You could of also be more specific about the types. Hope this helps. |
@samwgoldman I have the same error. I tried to use immutable.js (which have .js.flow with declarations) with flow. But it is inside node_modules directory, which is ignored.
|
I seem to have the same issue: #1816 |
Zaven just posted on Product Pains about this: https://productpains.com/post/flow/support-including-files-without-type-checking-them |
Bit me as well. Ideal behavior of flow would be just as all files in project's directory had |
Crazy to see this issue still opened. I've used third-party type definitions successfully for a while, but today I'd depended on package with actual types built in already. So I'd faced this issue too. I believe Flow must to not typecheck |
Hi, any progress or solution with this? |
@schovi How did you quickfixed this for immutable ? I don't get where I should copy the flow type file or include, so that I get at least something that works. |
@eric-burel I took this file https://github.com/facebook/immutable-js/blob/master/type-definitions/immutable.js.flow and copy it to root of flow libs. it should be in you
|
1年以上放置されたissueがある facebook/flow#1548 根本対応は↓を参照 http://qiita.com/mizchi/items/95ee0101ac22e4b7b662
@schovi I had to wrap the whole file content into |
Try installing library definitions from |
This situation is terrible and constantly keeps me from adapting flow on projects. Flowtype is constantly touting how easy it is to incrementally start using flow, while at the same time requiring any existing project to immediately either
Why is flow even trying to type check a third order dependency of of one of my eslint plugins? IT seems like the reasonable heuristic here is to not touch files that aren't even in the my apps dependency graph... |
It's a pain in the ass to distribute libraries with Please, reopen the issue. |
The issue is particularly acute when flow chooses to change the type of an already established return - say setInterval no longer returning a number (when the docs clearly state that it does). Now, every single module that happens to have use that function throws errors and countless libraries have to be updated by the maintainers before the project flows clean. Seeing all these errors and having to "just ignore them" causes signal attenuation and makes it hard to get any real value out of flow. |
How am i supposed to actually fix this? I just installed flow and i'm using Radium as a dependency. There's around 30 errors thrown from radium inside node_modules, and i did run flow-typed install already. |
@stevemk14ebr the only adequate way to use Flow right now is to:
|
@StreetStrider @stevemk14ebr Completely ignore is stupid since a lot of packages have correct types. You may easily treat broken modules as
|
@TrySound thank you, I'll look onto your solution. I was hoping for such one. My solution is bulletproof for a couple of reasons:
(3. I also remembering there was a performance issues scanning large |
|
|
Flow works fine with esm. It doesn't matter node or browser. I provide cjs dist via babel, but flow with esm. And interop works fine. |
@TrySound what your |
|
@TrySound great, thanks for the tips. I remember using Sometimes it's hard to say is it my issues using Flow or Flow issues itself. Docs are vague. |
Often flow issues are related to editor. I use vim+ale which works great with flow. And I never had issues with |
Btw, neither |
|
@benbieler This will treat all out of the box type definitions as |
@TrySound Okay thanks :) What do you mean with box type definitions? |
My
.flowconfig
file looks like this:I want to ignore everything that's located in node_modules, because it throws like 20 different errors when I turn it on.
Problem is, when I let's say
import _ from "lodash"
, Flow shouts at me that ^^^^^^^ lodash. Required module not found.How do I make Flow to not check
node_modules
but recognize it's modules?The text was updated successfully, but these errors were encountered: