airbnb / airbnb/javascript

no-global-assign should include all browser global variables when environment is browser

Open
#1,073 1 comment 0 reactions 0 assignees View on GitHub
question
Dominant language
JavaScript
Stars
148k
Forks
26.6k
PR merge metrics
No merged PRs in 30d

Description

We're using Airbnb style guide. Today I faced a bug that root of it was the fact that I had a variable named `location` which is a global object available in browser. So instead of getting `variable not defined: location` ESLint just passed.

[no-global-assign](http://eslint.org/docs/rules/no-global-assign) accepts an array of variable names that should be forbidden to use. All variable names like `location`, `document`, `window` and `navigator` should be in the blacklist as variable names.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the no-global-assign rule configuration described in the issue and inspect how this repository defines its ESLint rules. Check how browser globals such as location, document, window, and navigator are represented, then verify that the rule reports assignments to them when the environment is browser.

Written by the indexing model from the issue text.

Assessment

Tech stack
eslint, javascript
Domain
tooling
Issue type
Feature
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.