Create-react-app: Flow not work as expected with create react application

Created on 1 Mar 2018  路  4Comments  路  Source: facebook/create-react-app

I've added flow to my create react project but I did not any warn or errors in runtime build, please advice me to fix the issue

question

All 4 comments

@pavinthan In the front of Flow landing page, it says Flow: A static type checker for javascript, it just analyses your code as a linter but for type checking

To enable runtime checking, you may integrate https://github.com/codemix/flow-runtime or https://github.com/gcanti/tcomb, ....

@phthhieu I mean yarn flow with yarn start is possible?

I'm not sure there is a solution for it or not, there is a thread here https://stackoverflow.com/questions/30950032/how-can-i-run-multiple-npm-scripts-in-parallel, in my project I have 2 ways to see flow-type error

Declare a flowWatch script to run flow in a separate terminal tab!

// package.json
  "scripts": {
    "flowWatch": "fswatch -o ./ | xargs -n1 -I{} sh -c 'clear; printf \"\\033[3J\" && flow'",
    // ...other scripts
  }

the fswatch is from https://github.com/emcrisostomo/fswatch

Eslint plugin to see directly in code editor

https://github.com/amilajack/eslint-plugin-flowtype-errors

Flow errors are not checked by us, we can only parse it.
Please run your type checking separately and in your editor.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

dualcnhq picture dualcnhq  路  3Comments

adrice727 picture adrice727  路  3Comments

alleroux picture alleroux  路  3Comments

Evan-GK picture Evan-GK  路  3Comments

barcher picture barcher  路  3Comments