You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
JavaScript environments contain a number of built-in global variables, such as window in browsers and process in Node.js. In almost all cases, you don't want to assign a value to these global variables as doing so could result in losing access to important functionality. For example, you probably don't want to do this in browser code:
window={};
While examples such as window are obvious, there are often hundreds of built-in global objects provided by JavaScript environments. It can be hard to know if you're assigning to a global variable or not.
Rule Details
This rule disallows modifications to read-only global variables.
JavaScript environments contain a number of built-in global variables, such as
window
in browsers andprocess
in Node.js. In almost all cases, you don't want to assign a value to these global variables as doing so could result in losing access to important functionality. For example, you probably don't want to do this in browser code:While examples such as
window
are obvious, there are often hundreds of built-in global objects provided by JavaScript environments. It can be hard to know if you're assigning to a global variable or not.Rule Details
This rule disallows modifications to read-only global variables.
Examples of incorrect code for this rule:
http://eslint.org/docs/rules/no-global-assign
Likely to be uncontroversial. No repos fail. Will merge into standard v8 beta.
The text was updated successfully, but these errors were encountered: