From 34546f4f86c00aaa92588ca29e2b750637c941aa Mon Sep 17 00:00:00 2001 From: Dan Abramov Date: Mon, 8 May 2017 19:22:26 +0100 Subject: [PATCH 1/2] Revert "Ignore the yarn cache directory (#2063)" This reverts commit 94149c77a8d6e910b764ed53eb037eacb54c1871. From 679fc6f3900716f2908f91b74f54b55f975c66ad Mon Sep 17 00:00:00 2001 From: Dan Abramov Date: Mon, 8 May 2017 19:22:26 +0100 Subject: [PATCH 2/2] Revert "Forbid using window properties as global variables (#1840)" This reverts commit 5a7d8e899ef0f99d362f1195851ee832ccabfd86. --- packages/eslint-config-react-app/index.js | 8 +------- packages/react-scripts/fixtures/kitchensink/src/App.js | 4 ++-- .../kitchensink/src/features/webpack/NoExtInclusion.js | 2 +- .../src/features/webpack/UnknownExtInclusion.js | 2 +- 4 files changed, 5 insertions(+), 11 deletions(-) diff --git a/packages/eslint-config-react-app/index.js b/packages/eslint-config-react-app/index.js index 338f4c9f2c8..128b96e0db6 100644 --- a/packages/eslint-config-react-app/index.js +++ b/packages/eslint-config-react-app/index.js @@ -26,19 +26,13 @@ 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 1bf967d5224..3e57c3c5a79 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 window.Event('ReactFeatureDidMount')); + document.dispatchEvent(new Event('ReactFeatureDidMount')); } render() { @@ -54,7 +54,7 @@ class App extends Component { } componentDidMount() { - const feature = window.location.hash.slice(1); + const feature = 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 e3d4c621f51..7f824c2f292 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') - ? window.atob(aFileWithoutExt.split('base64,')[1]).trim() + ? 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 af88e96b637..70b046e9532 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') - ? window.atob(aFileWithExtUnknown.split('base64,')[1]).trim() + ? atob(aFileWithExtUnknown.split('base64,')[1]).trim() : aFileWithExtUnknown; export default () => (