In cases where I'm using flow.. /
// @flow
var foo = (str: string) => {
return str;
};
and Eslint together,
Eslint reports unexpected token on str: string
.
Is there a way to make Eslint ignore (or recognize) flow types and not report them as errors?
In cases where I'm using flow.. https://flowtype/
// @flow
var foo = (str: string) => {
return str;
};
and Eslint together,
Eslint reports unexpected token on str: string
.
Is there a way to make Eslint ignore (or recognize) flow types and not report them as errors?
Share Improve this question edited Mar 29, 2017 at 18:08 Nat Mote 4,08619 silver badges30 bronze badges asked Aug 8, 2016 at 0:42 GN.GN. 9,90914 gold badges71 silver badges141 bronze badges 2- 3 Look at this – Hamlet Hakobyan Commented Aug 8, 2016 at 0:47
- @HamletHakobyan - spot on! Can you post this as an answer? – Gabe Levi Commented Aug 8, 2016 at 15:38
1 Answer
Reset to default 8As Hamlet mentioned there is eslint-plugin-flowtype which will do a couple of things:
- Add syntax support for flow (and future JavaScript syntax) via babel-eslint
- Add additional eslint rules for linting flow syntax
Here are the Installation Instructions and Configuration docs.