Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

eslint warning no-use-before-define should not apply to flow types #2103

Closed
wereHamster opened this issue May 9, 2017 · 3 comments
Closed

Comments

@wereHamster
Copy link

Description

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.

Expected behavior

The no-use-before-define warning should not be reported.

Actual behavior

Warning appears in the console.

Reproducible Demo

Create a CRA project and place the following text into one of the files:

type Node = {
  children: Node[];
}
@gaearon
Copy link
Contributor

gaearon commented Jan 8, 2018

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.

@gaearon gaearon closed this as completed Jan 8, 2018
@gaearon
Copy link
Contributor

gaearon commented Jan 8, 2018

You can track this in babel/babel-eslint#485. When they fix it, we'll get the fix too. You can also try to help fixing this in babel-eslint repo :-)

@joa
Copy link

joa commented Jan 21, 2018

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: babel/babel-eslint#584

@lock lock bot locked and limited conversation to collaborators Jan 20, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants