Standard js, stream type definition is always undefined

I have a little problem with the template that I am currently setting up, I use Flow JS to enter the definition of my javascript for my application application, in bacground I have standard js launch, but it does not play well with my type notation

I continue to receive the following warning by definition of this type:

type NavItem = { name: string; link: string; } 

A warning

 frontend/src/Components/Sidebar/Navigation.react.js:5:6: 'NavItem' is not defined. 

what i am doing wrong is my configuration for standard js

 "standard": { "parser": "babel-eslint", "plugins": [ "flowtype" ], "rules": { "use-flow-type": 1 }, "ignore": [ "flow-typed/**/*.js", "src/registerServiceWorker.js" ] }, 

If someone has suggestions that I would love them, im is based on the cli create-react-app tool, if it makes other differences for you :)

+7
javascript eslint flowtype
source share
1 answer

There is an open ticket in the standard repo: # 984 - this is due to this problem.

As a workaround, you can go to babel-eslint@7.2.1 and wait for the fix. With a downgrade, we worked with the same problem.

You can also try to edit the standard rules - see babel-eslint # known-issues and eslint-config-standard .

+1
source share

All Articles