-
-
Notifications
You must be signed in to change notification settings - Fork 208
Class properties resulting in false positive #487
Comments
I don't know where this bug is... here is the eslint ref |
wow I didn't see that: did you just open the same issue some hours before I did? xD |
I opened it last night, but they (eslint) suggested the bug may be here. |
This is serious. |
Sorry this is causing issues. I'm not familiar with the codebase much. Could someone dive in a bit and provide a suggested solution/pull request? |
Is think broken in eslint 3.19 as well or just 4.0? |
i don't see any changes in this or eslint... how is it fixed? |
@soda0289 this wasn't a problem in eslint 3.x.x |
If this problem started with eslint v4 it probably has something to do with the new scope analysis fork eslint uses. It was changed from escope to eslint-scope. I think the problem is that babel-eslint is failing to find and monkey patch eslint-scope. It might be finding escope from some other installation of eslint. How are you running eslint? |
Rules in package.json
|
I'm on npm 5, node 8.
eslint is only depended on once in my package. |
So you are using the globally installed eslint. Can you try the locally installed one: |
that was the local one. I have |
I'm always local:
|
Why is this issue closed? There are multiple reports here and in eslint: |
This issue was resolved for me when upgrading to |
Occurs for me on 7.2.2 and eslint 4.3.0 |
Same here on 7.2.3 and ESLint 4.3.0. |
This was fixed for us (node |
It just went away for me... don't know when/how it changed. |
I'm having this problem with node v6.11.1, npm 5.3, [email protected], babel-eslint@^7.2.3 [email protected] [email protected] |
Same for me! ALARM! |
I can confirm I'm having this same issue as well. no-undef false positive with |
I was getting this just in the webpack build, and not when running |
FWIW it appears to occur when packages are installed with Yarn instead of NPM. Running This is the content of the
These are the versions of Node, NPM, and Yarn running on my machine: node --version
v6.11.2
npm --version
3.10.10
yarn --version
0.27.5 |
With eslint at If, like me, you have a global installation of eslint, you might want to check where the command is being run from. In my case the eslint version inside the project dependencies, where it was being run from, was an older one. After updating the dependency, props are no longer producing lint errors for me. Hope this helps! |
hey, it seems this still break eslint@3, maybe should pick a patch? |
I verified it's caused by the monkey patch.
Then, after I upgraded to webpack 4, everything broke without changing any eslint related versions. I verified this by doing I don't know an easy way to get rid of eslint-scope, so I chose to upgrade to latest versions of eslint 4 and eslint-babel 8 in the end. |
What @Bobgy said - just experienced the same thing with the same versions after an update to webpack 4. |
Just ran into this issue when I bumped the version of an unrelated dependency (not eslint/webpack/babel-eslint). Our organization has numerous modules using Seems like this issue should really be addressed as bringing in an unrelated dependency should not cause this sort of side affect. |
upgrade eslint latest |
This bug is back with
|
Same issue:
|
In a yarn workspace, you can prevent hoisting of the problematic
|
It's worked for me! |
can add back, but @storybook/react so far behind everything else... was causing hidden chaos in dev. See babel/babel-eslint#487 (comment)
can add back, but @storybook/react so far behind everything else... was causing hidden chaos in dev. See babel/babel-eslint#487 (comment)
@kryops this method is work for me! 👏 |
Upgrading to: Solved the issue for me. |
Having these issues with: |
Having the same issue with { doesn't work for me |
Any update on this issue? i have the same problem btw after upgrading babel from v6 to v7. using eslint 3.19.0 and babel eslint version 9.0.0 |
Since people (including me recently) are still running into this issue, and I just spent quite some time figuring it out, I would like to post a long answer with some reference. TL;DRThis should be solved by
with fix from Explanation:
A correct scope after After those two PRs, Take away: The easy way to 'just make things work' is always upgrade version. |
Getting this issue (using React Native). I previously only had "eslint-config-rallycoding": "^3.2.0" in my dev dependencies and eslint installed globally and everything was going smoothly. I had to install babel-eslint 7.2.1 to get operator chaining (a?.b) working without errors. This then caused this issue where arrow functions on classes were "undefined". I upgraded to the latest babel-eslint, and this gave me the error that it couldn't find "eslint-scope".
After installing the latest eslint in dev dependencies, renaming the workspace folder and restarting VSCode seemed to reset things and got everything working. |
Thank you for the issue. Now that |
In the following JS I get a "no-undef" on webpack compilation because of
inputPicks
andcontextTypes
static class properties but it does not happen firing ESLint from command line.Package.json
Dependencies:
The text was updated successfully, but these errors were encountered: