Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • C create-react-app
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 1,547
    • Issues 1,547
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 417
    • Merge requests 417
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Meta
  • create-react-app
  • Issues
  • #1530
Closed
Open
Issue created Feb 11, 2017 by Administrator@rootContributor

Blacklist `event` as a global we don't support implicitly

Created by: gaearon

Just saw @kittens bump into this in the office the other day:

  handleClick() {
    console.log(event);
  }

Guess what event is. A browser global (thanks IE).

In a tight code it is much less obvious, and easy to miss. This is especially problematic in React apps where event would actually correspond to something completely different than the synthetic event React is sending.

The problem is our ESLint configuration currently doesn't report event as an undefined variable because it's friendly to legacy code that may rely on it. We should figure out how to force it to treat undefined event as an undefined variable, and fail the build like we do for any other undefined variables. People who rely on it can always use window.event to be explicit.

Assignee
Assign to
Time tracking