Commit 5a7d8e89 authored by Siddharth Doshi's avatar Siddharth Doshi Committed by Joe Haddad
Browse files

Forbid using window properties as global variables (#1840)

* Forbid using window properties as global variables

* Change globals list to match Standard.

* Fix globals
parent 59c439bd
Showing with 11 additions and 5 deletions
+11 -5
......@@ -26,13 +26,19 @@ module.exports = {
plugins: ['import', 'flowtype', 'jsx-a11y', 'react'],
env: {
browser: true,
commonjs: true,
es6: true,
jest: true,
node: true,
},
globals: {
document: true,
window: true,
console: true,
navigator: true
},
parserOptions: {
ecmaVersion: 6,
sourceType: 'module',
......
......@@ -26,7 +26,7 @@ class BuiltEmitter extends Component {
}
handleReady() {
document.dispatchEvent(new Event('ReactFeatureDidMount'));
document.dispatchEvent(new window.Event('ReactFeatureDidMount'));
}
render() {
......@@ -54,7 +54,7 @@ class App extends Component {
}
componentDidMount() {
const feature = location.hash.slice(1);
const feature = window.location.hash.slice(1);
switch (feature) {
case 'array-destructuring':
import(
......
......@@ -11,7 +11,7 @@ import React from 'react';
import aFileWithoutExt from './assets/aFileWithoutExt';
const text = aFileWithoutExt.includes('base64')
? atob(aFileWithoutExt.split('base64,')[1]).trim()
? window.atob(aFileWithoutExt.split('base64,')[1]).trim()
: aFileWithoutExt;
export default () => (
......
......@@ -11,7 +11,7 @@ import React from 'react';
import aFileWithExtUnknown from './assets/aFileWithExt.unknown';
const text = aFileWithExtUnknown.includes('base64')
? atob(aFileWithExtUnknown.split('base64,')[1]).trim()
? window.atob(aFileWithExtUnknown.split('base64,')[1]).trim()
: aFileWithExtUnknown;
export default () => (
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment