Skip to content

don't check node_modules with flow#220

Open
beane wants to merge 2 commits into
verekia:masterfrom
beane:fix_flow_errors_on_node_modules
Open

don't check node_modules with flow#220
beane wants to merge 2 commits into
verekia:masterfrom
beane:fix_flow_errors_on_node_modules

Conversation

@beane

@beane beane commented May 20, 2017

Copy link
Copy Markdown

Written to fix this annoying issue. We probably shouldn't be flow checking our libraries, anyway.

Corresponding walkthrough PR

@verekia

verekia commented May 21, 2017

Copy link
Copy Markdown
Owner

This does not work for me. Flow chokes on every import.

@beane

beane commented May 21, 2017

Copy link
Copy Markdown
Author

@verekia can you elaborate? Does it choke after adding these ignore lines or was it choking before?

I'm using flow version 0.46.0. I see that the tutorial has 0.41.0. I didn't find anything in the CHANGELOGs, but maybe there's a difference in how flow reads the [ignore] block?

$ grep flow-bin yarn.lock
flow-bin@^0.46.0:
  resolved "https://registry.yarnpkg.com/flow-bin/-/flow-bin-0.46.0.tgz#06ad7fe19dddb1042264438064a2a32fee12b872"

@verekia

verekia commented May 21, 2017

Copy link
Copy Markdown
Owner

I used 0.46.0 as well for the test.
Sorry if that sounds rude, but did you actually test that change on the code of the tutorial?

@beane

beane commented May 21, 2017

Copy link
Copy Markdown
Author

Of course I did. I made the PR because the code as it is wasn't working.

Try using the walkthrough code.

cd js-stack-walkthrough/02-babel-es6-eslint-flow-jest-husky/
git checkout  fix_flow_errors_on_node_modules
yarn install
yarn test

Can you explain what you mean by

Flow chokes on every import.

I'm trying to figure out why it doesn't work for you. I'm confused how this didn't blow up in the first place without the [ignore] block.

@verekia

verekia commented May 21, 2017

Copy link
Copy Markdown
Owner

Okay I'll try your branch a bit later, but the errors I am getting when running flow on the final boilerplate of the tutorial are 45 messages like this one:

src/client/index.jsx:13
 13: import thunkMiddleware from 'redux-thunk'
                                 ^^^^^^^^^^^^^ redux-thunk. Required module not found

@verekia

verekia commented May 21, 2017

Copy link
Copy Markdown
Owner

Same errors in the walkthrough starting chapter 03.
I guess you only tried it on chapter 02?

@beane

beane commented May 26, 2017

Copy link
Copy Markdown
Author

Originally I only tried in chapter 02. I can confirm that it breaks the other chapters. I'll try to figure out why and how to prevent it.

If you use the following package.json file in 02 (blow away node_modules, yarn install etc) you should see that flow just blows up because it's trying to check some libraries in node_modules. I have no idea why it works with the original package.json -- trying to figure out what changes confused flow.

{
  "name": "your-project",
  "version": "1.0.0",
  "license": "MIT",
  "browserslist": ["> 1%"],
  "scripts": {
    "start": "babel-node src",
    "lint": "eslint src && flow"
  },
  "devDependencies": {
    "babel-cli": "^6.24.1",
    "babel-eslint": "^7.2.3",
    "babel-preset-env": "^1.5.1",
    "babel-preset-flow": "^6.23.0",
    "eslint": "^3.19.0",
    "eslint-config-airbnb": "^15.0.1",
    "eslint-plugin-compat": "^1.0.3",
    "eslint-plugin-flowtype": "^2.33.0",
    "eslint-plugin-import": "^2.2.0",
    "eslint-plugin-jsx-a11y": "^5.0.1",
    "eslint-plugin-react": "^7.0.1",
    "flow-bin": "^0.47.0"
  }
}

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

When yarn test after flow step getting an error

2 participants