Skip to content
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

Still checking non-dependencies in node_modules #5164

Open
mjomble opened this issue Oct 23, 2017 · 7 comments
Open

Still checking non-dependencies in node_modules #5164

mjomble opened this issue Oct 23, 2017 · 7 comments

Comments

@mjomble
Copy link
Contributor

mjomble commented Oct 23, 2017

The release notes of 0.57.0 mention this new feature:

Flow will now only check the files in node_modules/ which are direct or transitive dependencies of the non-node_modules code.

However, even with 0.57.3 (on Windows 7, if that matters), I'm still experiencing the same issue as in these reports:

#5023
dcodeIO/bcrypt.js#66

The bower.json file is neither a direct nor a transitive dependency of my non-node_modules code, but it still gets checked, which results in a failure.

If I rename it so it doesn't have a .json extension, Flow stops checking it.

I've also noticed from the server output that Flow is monitoring .css and .png files in node_modules for changes, which seems like unnecessary extra work.

Is this a bug or intentional?

@julien-f
Copy link

Same here with 0.63.1.

@massimonewsuk
Copy link

We have a project that uses flow. Our flow config looks like this:

[ignore]
.*/dist/.*
.*/loadtests/.*
.*/node_modules/config-chain/test/broken.json

[include]

[libs]

[lints]
all=error

[options]
include_warnings=true

We are using flow version 0.65.0. I have tried upgrading to the latest version too 0.69.0 but it doesn't seem to help.

Linux/Mac OS users can compile file but users on Windows see a whole load of flow errors related to stuff inside node_modules.

Seems very much related to this issue. Any ideas?

@mjomble
Copy link
Contributor Author

mjomble commented Apr 3, 2018

@massimonewsuk could you list some specific files under node_modules that are resulting in errors?
It is currently unclear whether they are actual dependencies or not.

@mjomble
Copy link
Contributor Author

mjomble commented Apr 3, 2018

Hmm, seems like a different problem to me.

Although they both fall into a larger "Flow errors from node_modules" category, this issue is more specifically about Flow checking a file that isn't directly or transitively included from non-node_modules code and in fact is a JSON file that doesn't contain any executable code or typedefs at all.

In your case, however, the files that Flow is checking actually do contain typedefs that are used by executable code.
The errors are caused by the fact that GraphQL typedefs (and probably those of other modules as well) are not meant to be checked with [lints] all=error.
What you're probably looking for instead is a way to configure Flow linting rules differently for node_modules code and your project's code.

@massimonewsuk
Copy link

@mjomble Sorry I just realised that these were actual dependencies, not non-dependencies. I deleted my comment with my package.json and errors because it's probably spamming this issue. I've created a separate issue for mine #6086

I agree with you about the how we would want to configure flow linting differently, but I'm also confused why it works on Linux and Mac OS and gives errors on Windows. Thanks for your help.

@alexeyraspopov
Copy link

I have exactly the same issue since there is indirect dependency on config-chain. I've opened a related ticket in Parcel parcel-bundler/parcel#1526. The mentioned package has purposely invalid JSON file as a part of tests which for sure is not a part of dependencies graph. Flow version is 0.74.0.

@mrkev
Copy link
Contributor

mrkev commented Jul 5, 2018

More discussion on this here #869

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants