-
-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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
no-use-before-define false positive with binding exports #7858
Comments
I confirmed it from the spec.
|
@ljharb Do you happen to know the correct behavior for this? |
My initial impression was that the last example should work just fine. However, I think @Kovensky is correct - I can't speak to the spec text since grammar stuff isn't my specialty, but this is now my intuition having thought it through. |
Closing this issue since the consensus in the PR was that the current default behavior is correct. |
Tell us about your environment
What parser (default, Babel-ESLint, etc.) are you using?
babel-eslint
Please show your full configuration:
What did you do? Please include the actual source code causing the issue.
What did you expect to happen?
No warnings.
What actually happened? Please include the actual, raw output from ESLint.
Binding exports do not read the variable, so they do not cause TDZ errors.
Note that, when circular imports are involved, it is possible to cause a TDZ error by accessing an export whose binding is still in TDZ, but that would happen regardless of the position of the
export
binding.Also note that only binding exports should not be errors.
export default
should error as it is a value*, not a binding:[*]: it is a binding when exporting
FunctionDeclaration
orClassDeclaration
, but those are already correctly handled, in theexport default
case, by the rule with the appropriate options.The text was updated successfully, but these errors were encountered: