I want to add flow support to a nuxt project (my project uses webpack and babel). Can I find a working example somewhere?
If I run flow check
, there are no errors, bun when I run yarn run dev
, I get a syntax error.
(I know there are these unanswered questions out there, I raise the same issue again hoping this time it will reach some guys with knowledge on the matter.)
Thanks
There a lot of things to configure. Let me guide you trough this process.
TLDR: use
wemake-vue-template
. It comes withnuxt
,flow
, and many other goodies.Babel
First of all, we need to configure
babel
. That's how yourbabel
configuration should look like:Install these presents with
npm install --save-dev babel-preset-flow babel-preset-vue-app
.Eslint
Next, we need to configure
eslint
to lint ourflow
files. That's how.eslintrc
should look like:Make sure that you have installed everything.
.flowconfig
That's the hardest part. You need to specify configuration for
flow
. It may differ based on your setup.nuxt.config.js
The last step. We need to enable linting on each change.
That's it. Now you will have working
flow
type checking.