Skip to content
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

Global scope detection (for "no-global") is incorrect #7

getify opened this Issue Mar 12, 2019 · 0 comments


None yet
1 participant
Copy link

getify commented Mar 12, 2019

The current detection makes an assumption about global scopes which doesn't hold for when the script in question is being linted as if in a node/commonjs env, as they create an "extra" scope below the real global for your script's top-level scope.

Detecting this environment difference is quite tricky/nuanced, since env setup is not reported to plugins. But it turns out it can be detected by looking at context.parserOptions.ecmaFeatures.globalReturn, which if set to true, means the extra scope has been created.

@getify getify added the bug label Mar 12, 2019

@getify getify closed this in c841b84 Mar 12, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.