Skip to content
This repository has been archived by the owner on Aug 18, 2021. It is now read-only.

Flow type incorrectly determined to be undefined #66

Closed
leebyron opened this issue Apr 8, 2015 · 1 comment
Closed

Flow type incorrectly determined to be undefined #66

leebyron opened this issue Apr 8, 2015 · 1 comment
Labels

Comments

@leebyron
Copy link
Contributor

leebyron commented Apr 8, 2015

Running eslint with babel-eslint and using flow types:

type SomeNewType = any;

will fail the no-undef lint with 'SomeNewType' is not defined

Appears to be because TypeAlias AST node walks over the id field which is Identifier and eslint mistakes it for an undefined variable usage.

Not sure how exactly to proceed with a fix for this - should babel process out the flow annotations from the AST before passing to eslint?

leebyron added a commit to leebyron/babel-eslint that referenced this issue Apr 8, 2015
This is a work-around for babel#66, extending the monkeypatch to escope to ensure it does not traverse into TypeAlias nodes and incorrectly infer a reference.
@leebyron leebyron mentioned this issue Apr 8, 2015
@sebmck
Copy link
Contributor

sebmck commented Apr 8, 2015

Closed via #67.

@sebmck sebmck closed this as completed Apr 8, 2015
hzoo added a commit to hzoo/babel-eslint that referenced this issue May 17, 2015
@hzoo hzoo added the bug label Aug 15, 2015
nicolo-ribaudo pushed a commit to babel/babel that referenced this issue Nov 14, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants