intentionally malformed package.json fixture in tests breaks flowtype when checking node_modules
paritosh-yadav opened this issue · 9 comments
Steps to regenerate:-
npm install resolve
- run
flow
command
flow output:-
Error ┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈ node_modules/resolve/test/resolver/malformed_package_json/package.json:2:1 Unexpected end of input, expected the token }
1│ {
2│
@ljharb, Kindly respond. Thank you
Why is flow checking node_modules?
To collect published types. It finds package.json to check for entry point and cannot parse it. Why tests are published anyway? Do they or ci configs have any use in node_modules?
@TrySound Tests are published in all my packages because npm explore foo && npm install && npm test
should always work.
It seems like a bug should be filed on flow so that it doesn't fail when it encounters invalid JSON, especially inside node_modules. Please link to it here when that’s filed.
Hi @ljharb ,
I have ignored the lib in flow config. Previously ignoring lib isn't working, but now it is.
I'd still suggest filing a bug on flow itself, so that by default it doesn't crash on this case.
Closing, since the only issue I know about here is caused by flow, and ignoring the file in flow config works. Happy to reopen if a different scenario is causing problems.
So you can ignore when problems arise in flow?
@jacksontims123 i closed this under the assumption that #262 (comment) means you can indeed ignore that file path, and flow will avoid crashing.
It seems like a bug should be filed on flow so that it doesn't fail when it encounters invalid JSON, especially inside node_modules. Please link to it here when that’s filed.