Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.
Sign upDisallow assignment to native objects or read-only global variables (no-global-assign) #596
Comments
feross
added
the
enhancement
label
Aug 19, 2016
feross
added this to the
standard v8 milestone
Aug 19, 2016
feross
closed this
in
standard/eslint-config-standard@a34f0f9
Aug 19, 2016
Merged
lock
bot
locked as resolved and limited conversation to collaborators
May 10, 2018
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
feross commentedAug 19, 2016
JavaScript environments contain a number of built-in global variables, such as
windowin browsers andprocessin 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
windoware 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.