Babel-eslint: Flow types breaks in latest version v8.0.1 but doesn't in v7.1.1

Created on 2 Nov 2017  路  5Comments  路  Source: babel/babel-eslint

Hi,

All my flow variables give "no-undef" error when I upgrade babel-eslint to v8.0.1 but i don't get the same error in v7.1.1. Can you please let me know what has happened here and also advise me on whether I need to do any workarounds when using v8.0.1.

Most helpful comment

Which version of eslint are you using? I found that when there is eslint@3 and eslint-scope, the same problem occurs, probably because of the conflicts of scope handlling: eslint@3 uses escope to handle JavaScript scopes while babel-eslint uses eslint-scope.

In my environment, eslint-scope was installed as one of the webpack@4's dependencies.

The problem was resolved when I updated eslint to its latest as eslint@4 uses eslint-scope instead of escope.

The minimum code to reproduce: https://github.com/nodaguti/babel-eslint-scoping-bug/

All 5 comments

Thanks for the report, I'l need you to provide more exact reproduction steps. I just know that it doesn't work with flow variables?

Also can you try v8.0.2? Seems like npm/yarn aren't resolving beta versions correctly

It breaks in 8.0.2 as well. As of now 7.1.1 works like a charm.

i am also experiencing this, works fine on 7.2.0, but i start to get the no-undef and no-unused-vars from 7.2.2.

i used to have 7.2.3 but after i updated webpack to 4.3.0 (don't know how is that related) it started failing, i use eslint-plugin-flowtype but upgrading that to 2.46.1 did not help (i also updated some other dependencies but those are the main ones)

Which version of eslint are you using? I found that when there is eslint@3 and eslint-scope, the same problem occurs, probably because of the conflicts of scope handlling: eslint@3 uses escope to handle JavaScript scopes while babel-eslint uses eslint-scope.

In my environment, eslint-scope was installed as one of the webpack@4's dependencies.

The problem was resolved when I updated eslint to its latest as eslint@4 uses eslint-scope instead of escope.

The minimum code to reproduce: https://github.com/nodaguti/babel-eslint-scoping-bug/

Thank you for the issue. Now that @babel/eslint-parser has been released, we are making this repository read-only. If this is a change you would still like to advocate for, please reopen this in the babel/babel monorepo.

Was this page helpful?
0 / 5 - 0 ratings