diff --git a/packages/eslint-config-react-app/index.js b/packages/eslint-config-react-app/index.js index 128b96e0db6767dcb9edc2f0196f777918f7a3d1..338f4c9f2c80d62de3ede92941007f99b41570a9 100644 --- a/packages/eslint-config-react-app/index.js +++ b/packages/eslint-config-react-app/index.js @@ -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', diff --git a/packages/react-scripts/fixtures/kitchensink/src/App.js b/packages/react-scripts/fixtures/kitchensink/src/App.js index 3e57c3c5a79285906609d5db2197ff6454c9e9a3..1bf967d5224959a3dd49c87e6898919bc431c7a5 100644 --- a/packages/react-scripts/fixtures/kitchensink/src/App.js +++ b/packages/react-scripts/fixtures/kitchensink/src/App.js @@ -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( diff --git a/packages/react-scripts/fixtures/kitchensink/src/features/webpack/NoExtInclusion.js b/packages/react-scripts/fixtures/kitchensink/src/features/webpack/NoExtInclusion.js index 7f824c2f2923832260cc58217e7eac7beebf48e2..e3d4c621f51e488c3a6991043d1f627d917d1aab 100644 --- a/packages/react-scripts/fixtures/kitchensink/src/features/webpack/NoExtInclusion.js +++ b/packages/react-scripts/fixtures/kitchensink/src/features/webpack/NoExtInclusion.js @@ -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 () => ( diff --git a/packages/react-scripts/fixtures/kitchensink/src/features/webpack/UnknownExtInclusion.js b/packages/react-scripts/fixtures/kitchensink/src/features/webpack/UnknownExtInclusion.js index 70b046e953290e4d32141470d5013e0e672a3913..af88e96b6378419f867d85b10bdca12d834df066 100644 --- a/packages/react-scripts/fixtures/kitchensink/src/features/webpack/UnknownExtInclusion.js +++ b/packages/react-scripts/fixtures/kitchensink/src/features/webpack/UnknownExtInclusion.js @@ -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 () => (