The default eslint rules warn about no-use-before-define
of flow types. The warning is pointless because 'use before define' does not apply to flow types. This makes it impossible for example to define recursive types.
The no-use-before-define
warning should not be reported.
Warning appears in the console.
Create a CRA project and place the following text into one of the files:
type Node = {
children: Node[];
}
Please report this to the upstream projects (in this case, maybe babel-eslint
or eslint
itself). Or perhaps eslint-plugin-flowtype
can help with this.
You can track this in https://github.com/babel/babel-eslint/issues/485. When they fix it, we'll get the fix too. You can also try to help fixing this in babel-eslint
repo :-)
Submitted a PR. Not really sure if it is _the right way_ â„¢ since I have no experience with Babel or ESLint but all tests are passing: https://github.com/babel/babel-eslint/pull/584
Most helpful comment
Submitted a PR. Not really sure if it is _the right way_ â„¢ since I have no experience with Babel or ESLint but all tests are passing: https://github.com/babel/babel-eslint/pull/584