-
Notifications
You must be signed in to change notification settings - Fork 0
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
eslint: Bad use of globals #238
Labels
Comments
1 task
nexushoratio
pushed a commit
that referenced
this issue
Feb 2, 2024
nexushoratio
pushed a commit
that referenced
this issue
Feb 8, 2024
nexushoratio
pushed a commit
that referenced
this issue
Feb 8, 2024
Identify those currently being used so they can be fixed. Issue #238.
9 tasks
nexushoratio
pushed a commit
that referenced
this issue
Feb 12, 2024
nexushoratio
pushed a commit
that referenced
this issue
Feb 14, 2024
nexushoratio
pushed a commit
that referenced
this issue
Feb 16, 2024
nexushoratio
pushed a commit
that referenced
this issue
Feb 18, 2024
Dealing with One approach had been to disallow certain words as IDs. But, it turns out that eslint rule impacts not only variables, but field names as well. For those processed so far, was never an issue. But |
nexushoratio
pushed a commit
that referenced
this issue
Feb 23, 2024
This change addresses local variable. Issue #238. ␄
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Apparently there are some JS globals in the browser environment that are commonly used locals, like name, self, toolbar, and event. So tools like
eslint
that know about them will not flag them withno-undef
. As a result, at least one minor cosmetic bug exists:Shortcut
s do not get their name property set because the same named local variable was not set.Not yet sure what the proper solution is.
Setting
no-shadow.builtinGlobals = true
is one solution, but that just disallows us from reusing that name, but not from accidentally using it.Setting
globals.name = off
forces using it locally, but we are still shadowing it, and difficult to know about them. Maybe there is a way to disallow certain variables, and somehow keep it in sync with known globals.Also, seems to be at least 59 existing cases of reusing a global variable, mostly name.
Removing
browser
from the environment would expose 17 currently functions, and it means that testing new browser functions would require manually updating the list. Or, always go through globalThis for everything, and have it be the only known global property.Exception
class #259The text was updated successfully, but these errors were encountered: