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
"declare global" prevents accessing parent scope (no-undef) #21
Comments
@JamesHenry I'm running into the same error. It only happens a few times in my codebase so it's easy enough to ignore, but I'm wondering if there's a workaround or if there are any plans to update the rule. |
Recommendation is to turn off the rule, as the typescript compiler itself should handle everything that the rule covers. Otherwise - no plans right now. It involves adding scope analysis support, which is a huge piece of work none of the core maintainers have time to work on right now. |
Merging into #1856 |
This issue was initially reported here: eslint/typescript-eslint-parser#579
What version of TypeScript are you using?
3.1.3
What version of
typescript-eslint-parser
are you using?21.0.2
What code were you trying to parse?
What did you expect to happen?
No lint errors
What happened?
typescript-eslint-parser/analyze-scope.js:Referencer.visitGlobalAugmentation seems to replace the current scope with the global one, which makes accessing
React
in the above exampleincorrectly say it's not defined.
@mysticatea (via #540): what case does visitGlobalAugmentation solve?
The text was updated successfully, but these errors were encountered: