-
-
Notifications
You must be signed in to change notification settings - Fork 27.2k
Closed
Milestone
Description
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.
Metadata
Metadata
Assignees
Labels
No labels