Eslint reports stream types as syntax error

In cases where I use a stream. https://flowtype.org/

// @flow
var foo = (str: string) => {
  return str;
};

and Eslint together, Eslint reports an unexpected token on str: string.

Is there a way to force Eslint to ignore (or recognize) stream types and not report errors?

+4
source share
1 answer

As Hamlet mentioned, there is eslint-plugin-flowtype that will do a few things:

  • Add syntax support for the stream (and future JavaScript syntax) via babel-eslint
  • eslint

docs.

+5

Source: https://habr.com/ru/post/1650489/


All Articles