Don't allow global access to all of window

We had a bug where `stop()` was undefined but it fell back to the function on window which was inplicitly in the global scope.

This should reduce that kind of thing.
This commit is contained in:
Jordan Eldredge 2019-08-20 07:42:54 -07:00
parent 0472033fba
commit e79520dbdd
2 changed files with 21 additions and 3 deletions

View file

@ -28,15 +28,32 @@
}
},
"env": {
"browser": true,
"node": true,
"amd": true,
"es6": true,
"jest": true
},
// TODO: Consider removing some of these.
// https://github.com/facebook/create-react-app/pull/1840
// Create React App and "Standard" only allow the following:
// * document
// * window
// * console
// * navigator
"globals": {
"page": true,
"browser": true
"window": true,
"document": true,
"console": true,
"navigator": true,
"alert": true,
"Blob": true,
"fetch": true,
"FileReader": true,
"Element": true,
"AudioNode": true,
"MutationObserver": true,
"Image": true,
"location": true
},
"rules": {
"no-multiple-empty-lines": [

View file

@ -1,3 +1,4 @@
/* global page */
const { toMatchImageSnapshot } = require("jest-image-snapshot");
expect.extend({ toMatchImageSnapshot });