From b3ffdcf24350a607f112f4464648033b40d2b62a Mon Sep 17 00:00:00 2001 From: Nick McCurdy Date: Sun, 25 Oct 2020 11:10:54 -0400 Subject: [PATCH 1/6] feat: remove remaining React imports --- .../docs/adding-a-css-modules-stylesheet.md | 2 +- docusaurus/docs/adding-a-stylesheet.md | 2 +- .../docs/adding-images-fonts-and-files.md | 1 - docusaurus/docs/code-splitting.md | 2 +- docusaurus/docs/importing-a-component.md | 4 ++-- docusaurus/docs/running-tests.md | 2 -- docusaurus/website/src/pages/index.js | 1 - .../template/src/App.test.tsx | 1 - .../template/src/App.tsx | 1 - .../template/src/index.tsx | 1 - packages/cra-template/template/src/index.js | 1 - .../src/components/CloseButton.js | 2 +- .../src/components/CodeBlock.js | 2 +- .../src/components/Collapsible.js | 2 +- .../src/components/ErrorOverlay.js | 2 +- .../src/components/Footer.js | 2 +- .../src/components/Header.js | 2 +- .../src/components/NavigationBar.js | 2 +- .../src/containers/CompileErrorContainer.js | 2 +- .../src/containers/RuntimeError.js | 1 - .../src/containers/RuntimeErrorContainer.js | 2 +- .../src/containers/StackFrame.js | 2 +- .../src/containers/StackFrameCodeBlock.js | 2 +- .../src/containers/StackTrace.js | 2 +- .../react-error-overlay/src/iframeScript.js | 2 +- .../fixtures/kitchensink/template/src/App.js | 2 +- .../template/src/features/config/BaseUrl.js | 2 +- .../src/features/config/BaseUrl.test.js | 1 - .../src/features/env/ExpandEnvVariables.js | 2 -- .../features/env/ExpandEnvVariables.test.js | 1 - .../src/features/env/FileEnvVariables.js | 2 -- .../src/features/env/FileEnvVariables.test.js | 1 - .../template/src/features/env/PublicUrl.js | 2 -- .../src/features/env/PublicUrl.test.js | 1 - .../src/features/env/ShellEnvVariables.js | 2 -- .../src/features/env/ShellEnvVariables.test.js | 1 - .../src/features/syntax/ArrayDestructuring.js | 2 +- .../features/syntax/ArrayDestructuring.test.js | 1 - .../src/features/syntax/ArraySpread.js | 2 +- .../src/features/syntax/ArraySpread.test.js | 1 - .../template/src/features/syntax/AsyncAwait.js | 18 ++---------------- .../src/features/syntax/AsyncAwait.test.js | 1 - .../src/features/syntax/ClassProperties.js | 2 +- .../features/syntax/ClassProperties.test.js | 1 - .../src/features/syntax/ComputedProperties.js | 2 +- .../features/syntax/ComputedProperties.test.js | 1 - .../src/features/syntax/CustomInterpolation.js | 2 +- .../syntax/CustomInterpolation.test.js | 1 - .../src/features/syntax/DefaultParameters.js | 2 +- .../features/syntax/DefaultParameters.test.js | 1 - .../features/syntax/DestructuringAndAwait.js | 2 +- .../syntax/DestructuringAndAwait.test.js | 1 - .../template/src/features/syntax/Generators.js | 2 +- .../src/features/syntax/Generators.test.js | 1 - .../src/features/syntax/NullishCoalescing.js | 2 +- .../features/syntax/NullishCoalescing.test.js | 1 - .../src/features/syntax/ObjectDestructuring.js | 2 +- .../syntax/ObjectDestructuring.test.js | 1 - .../src/features/syntax/ObjectSpread.js | 2 +- .../src/features/syntax/ObjectSpread.test.js | 1 - .../src/features/syntax/OptionalChaining.js | 2 +- .../features/syntax/OptionalChaining.test.js | 1 - .../template/src/features/syntax/Promises.js | 2 +- .../src/features/syntax/Promises.test.js | 1 - .../src/features/syntax/RestAndDefault.js | 2 +- .../src/features/syntax/RestAndDefault.test.js | 1 - .../src/features/syntax/RestParameters.js | 2 +- .../src/features/syntax/RestParameters.test.js | 1 - .../features/syntax/TemplateInterpolation.js | 2 +- .../syntax/TemplateInterpolation.test.js | 1 - .../src/features/webpack/CssInclusion.js | 1 - .../src/features/webpack/CssInclusion.test.js | 1 - .../features/webpack/CssModulesInclusion.js | 1 - .../webpack/CssModulesInclusion.test.js | 1 - .../src/features/webpack/DynamicImport.js | 2 -- .../src/features/webpack/DynamicImport.test.js | 1 - .../src/features/webpack/ImageInclusion.js | 1 - .../features/webpack/ImageInclusion.test.js | 1 - .../src/features/webpack/JsonInclusion.js | 1 - .../src/features/webpack/JsonInclusion.test.js | 1 - .../src/features/webpack/LinkedModules.js | 1 - .../src/features/webpack/LinkedModules.test.js | 1 - .../src/features/webpack/NoExtInclusion.js | 1 - .../features/webpack/NoExtInclusion.test.js | 1 - .../src/features/webpack/SassInclusion.js | 1 - .../src/features/webpack/SassInclusion.test.js | 1 - .../features/webpack/SassModulesInclusion.js | 1 - .../webpack/SassModulesInclusion.test.js | 1 - .../src/features/webpack/ScssInclusion.js | 1 - .../src/features/webpack/ScssInclusion.test.js | 1 - .../features/webpack/ScssModulesInclusion.js | 1 - .../webpack/ScssModulesInclusion.test.js | 1 - .../src/features/webpack/SvgComponent.js | 1 - .../src/features/webpack/SvgComponent.test.js | 1 - .../template/src/features/webpack/SvgInCss.js | 1 - .../src/features/webpack/SvgInCss.test.js | 1 - .../src/features/webpack/SvgInclusion.js | 1 - .../src/features/webpack/SvgInclusion.test.js | 1 - .../features/webpack/UnknownExtInclusion.js | 1 - .../webpack/UnknownExtInclusion.test.js | 1 - .../fixtures/kitchensink/template/src/index.js | 1 - test/fixtures/boostrap-sass/src/index.js | 1 - .../builds-with-multiple-runtimes/src/index.js | 1 - .../global-scss-asset-resolution/src/index.js | 1 - test/fixtures/jsconfig/src/App.js | 2 +- test/fixtures/jsconfig/src/App.test.js | 1 - test/fixtures/jsconfig/src/index.js | 1 - test/fixtures/mjs-support/src/App.js | 1 - test/fixtures/mjs-support/src/index.js | 1 - .../src/AppAliasUnknownExport.js | 2 +- .../webpack-message-formatting/src/AppBabel.js | 2 +- .../webpack-message-formatting/src/AppCss.js | 2 +- .../src/AppIncorrectCase.js | 2 +- .../src/AppLintError.js | 2 +- .../src/AppLintWarning.js | 2 +- .../src/AppMissingPackage.js | 2 +- .../src/AppNoDefault.js | 2 +- .../src/AppOutOfScopeImport.js | 2 +- .../webpack-message-formatting/src/AppSass.js | 2 +- .../src/AppUnknownExport.js | 2 +- .../src/AppUnknownFile.js | 2 +- .../webpack-message-formatting/src/index.js | 1 - 122 files changed, 51 insertions(+), 144 deletions(-) diff --git a/docusaurus/docs/adding-a-css-modules-stylesheet.md b/docusaurus/docs/adding-a-css-modules-stylesheet.md index be16918284..b33c073e5f 100644 --- a/docusaurus/docs/adding-a-css-modules-stylesheet.md +++ b/docusaurus/docs/adding-a-css-modules-stylesheet.md @@ -31,7 +31,7 @@ CSS Modules let you use the same CSS class name in different files without worry ## `Button.js` ```js -import React, { Component } from 'react'; +import { Component } from 'react'; import styles from './Button.module.css'; // Import css modules stylesheet as styles import './another-stylesheet.css'; // Import regular stylesheet diff --git a/docusaurus/docs/adding-a-stylesheet.md b/docusaurus/docs/adding-a-stylesheet.md index f1dea111bc..fc2066b998 100644 --- a/docusaurus/docs/adding-a-stylesheet.md +++ b/docusaurus/docs/adding-a-stylesheet.md @@ -17,7 +17,7 @@ This project setup uses [webpack](https://webpack.js.org/) for handling all asse ## `Button.js` ```js -import React, { Component } from 'react'; +import { Component } from 'react'; import './Button.css'; // Tell webpack that Button.js uses these styles class Button extends Component { diff --git a/docusaurus/docs/adding-images-fonts-and-files.md b/docusaurus/docs/adding-images-fonts-and-files.md index 67cc4b53d2..cf0f91fde2 100644 --- a/docusaurus/docs/adding-images-fonts-and-files.md +++ b/docusaurus/docs/adding-images-fonts-and-files.md @@ -12,7 +12,6 @@ To reduce the number of requests to the server, importing images that are less t Here is an example: ```js -import React from 'react'; import logo from './logo.png'; // Tell webpack this JS file uses this image console.log(logo); // /logo.84287d09.png diff --git a/docusaurus/docs/code-splitting.md b/docusaurus/docs/code-splitting.md index 2fabb6b40c..b8d0d2d603 100644 --- a/docusaurus/docs/code-splitting.md +++ b/docusaurus/docs/code-splitting.md @@ -20,7 +20,7 @@ export { moduleA }; ## `App.js` ```js -import React, { Component } from 'react'; +import { Component } from 'react'; class App extends Component { handleClick = () => { diff --git a/docusaurus/docs/importing-a-component.md b/docusaurus/docs/importing-a-component.md index 2f4a4c56a6..1de62a628c 100644 --- a/docusaurus/docs/importing-a-component.md +++ b/docusaurus/docs/importing-a-component.md @@ -12,7 +12,7 @@ For example: ## `Button.js` ```js -import React, { Component } from 'react'; +import { Component } from 'react'; class Button extends Component { render() { @@ -26,7 +26,7 @@ export default Button; // Don’t forget to use export default! ## `DangerButton.js` ```js -import React, { Component } from 'react'; +import { Component } from 'react'; import Button from './Button'; // Import a component from another file class DangerButton extends Component { diff --git a/docusaurus/docs/running-tests.md b/docusaurus/docs/running-tests.md index ccc3fecd9a..059e845a36 100644 --- a/docusaurus/docs/running-tests.md +++ b/docusaurus/docs/running-tests.md @@ -71,7 +71,6 @@ There is a broad spectrum of component testing techniques. They range from a “ Different projects choose different testing tradeoffs based on how often components change, and how much logic they contain. If you haven’t decided on a testing strategy yet, we recommend that you start with creating basic smoke tests for your components: ```js -import React from 'react'; import ReactDOM from 'react-dom'; import App from './App'; @@ -112,7 +111,6 @@ import '@testing-library/jest-dom'; Here's an example of using `react-testing-library` and `jest-dom` for testing that the `` component renders "Learn React". ```js -import React from 'react'; import { render, screen } from '@testing-library/react'; import App from './App'; diff --git a/docusaurus/website/src/pages/index.js b/docusaurus/website/src/pages/index.js index feda132f3c..6b5443e262 100644 --- a/docusaurus/website/src/pages/index.js +++ b/docusaurus/website/src/pages/index.js @@ -5,7 +5,6 @@ * LICENSE file in the root directory of this source tree. */ -import React from 'react'; import Link from '@docusaurus/Link'; import useDocusaurusContext from '@docusaurus/useDocusaurusContext'; import useBaseUrl from '@docusaurus/useBaseUrl'; diff --git a/packages/cra-template-typescript/template/src/App.test.tsx b/packages/cra-template-typescript/template/src/App.test.tsx index 2a68616d98..1f03afeece 100644 --- a/packages/cra-template-typescript/template/src/App.test.tsx +++ b/packages/cra-template-typescript/template/src/App.test.tsx @@ -1,4 +1,3 @@ -import React from 'react'; import { render, screen } from '@testing-library/react'; import App from './App'; diff --git a/packages/cra-template-typescript/template/src/App.tsx b/packages/cra-template-typescript/template/src/App.tsx index a53698aab3..e5fcd6355a 100644 --- a/packages/cra-template-typescript/template/src/App.tsx +++ b/packages/cra-template-typescript/template/src/App.tsx @@ -1,4 +1,3 @@ -import React from 'react'; import logo from './logo.svg'; import './App.css'; diff --git a/packages/cra-template-typescript/template/src/index.tsx b/packages/cra-template-typescript/template/src/index.tsx index ef2edf8ea3..fda99ee1f6 100644 --- a/packages/cra-template-typescript/template/src/index.tsx +++ b/packages/cra-template-typescript/template/src/index.tsx @@ -1,4 +1,3 @@ -import React from 'react'; import ReactDOM from 'react-dom'; import './index.css'; import App from './App'; diff --git a/packages/cra-template/template/src/index.js b/packages/cra-template/template/src/index.js index ef2edf8ea3..fda99ee1f6 100644 --- a/packages/cra-template/template/src/index.js +++ b/packages/cra-template/template/src/index.js @@ -1,4 +1,3 @@ -import React from 'react'; import ReactDOM from 'react-dom'; import './index.css'; import App from './App'; diff --git a/packages/react-error-overlay/src/components/CloseButton.js b/packages/react-error-overlay/src/components/CloseButton.js index 2b387c86a9..7fed23dd3f 100644 --- a/packages/react-error-overlay/src/components/CloseButton.js +++ b/packages/react-error-overlay/src/components/CloseButton.js @@ -6,7 +6,7 @@ */ /* @flow */ -import React, { useContext } from 'react'; +import { useContext } from 'react'; import { ThemeContext } from '../iframeScript'; import type { Theme } from '../styles'; diff --git a/packages/react-error-overlay/src/components/CodeBlock.js b/packages/react-error-overlay/src/components/CodeBlock.js index 13a740bb46..a2abcfe81c 100644 --- a/packages/react-error-overlay/src/components/CodeBlock.js +++ b/packages/react-error-overlay/src/components/CodeBlock.js @@ -6,7 +6,7 @@ */ /* @flow */ -import React, { useContext } from 'react'; +import { useContext } from 'react'; import { ThemeContext } from '../iframeScript'; const _preStyle = { diff --git a/packages/react-error-overlay/src/components/Collapsible.js b/packages/react-error-overlay/src/components/Collapsible.js index 9586e7f000..b0194092ea 100644 --- a/packages/react-error-overlay/src/components/Collapsible.js +++ b/packages/react-error-overlay/src/components/Collapsible.js @@ -6,7 +6,7 @@ */ /* @flow */ -import React, { useState, useContext } from 'react'; +import { useState, useContext } from 'react'; import { ThemeContext } from '../iframeScript'; import type { Element as ReactElement } from 'react'; diff --git a/packages/react-error-overlay/src/components/ErrorOverlay.js b/packages/react-error-overlay/src/components/ErrorOverlay.js index 593d48d214..9bdf345a2c 100644 --- a/packages/react-error-overlay/src/components/ErrorOverlay.js +++ b/packages/react-error-overlay/src/components/ErrorOverlay.js @@ -6,7 +6,7 @@ */ /* @flow */ -import React, { useContext, useEffect } from 'react'; +import { useContext, useEffect } from 'react'; import { ThemeContext } from '../iframeScript'; import type { Node as ReactNode } from 'react'; diff --git a/packages/react-error-overlay/src/components/Footer.js b/packages/react-error-overlay/src/components/Footer.js index 0ef8e11eea..88f0b66036 100644 --- a/packages/react-error-overlay/src/components/Footer.js +++ b/packages/react-error-overlay/src/components/Footer.js @@ -6,7 +6,7 @@ */ /* @flow */ -import React, { useContext } from 'react'; +import { useContext } from 'react'; import { ThemeContext } from '../iframeScript'; import type { Theme } from '../styles'; diff --git a/packages/react-error-overlay/src/components/Header.js b/packages/react-error-overlay/src/components/Header.js index 6f87cdd9b7..f19972e292 100644 --- a/packages/react-error-overlay/src/components/Header.js +++ b/packages/react-error-overlay/src/components/Header.js @@ -6,7 +6,7 @@ */ /* @flow */ -import React, { useContext } from 'react'; +import { useContext } from 'react'; import { ThemeContext } from '../iframeScript'; import type { Theme } from '../styles'; diff --git a/packages/react-error-overlay/src/components/NavigationBar.js b/packages/react-error-overlay/src/components/NavigationBar.js index 45bce8a5b6..e38a3d6d4e 100644 --- a/packages/react-error-overlay/src/components/NavigationBar.js +++ b/packages/react-error-overlay/src/components/NavigationBar.js @@ -6,7 +6,7 @@ */ /* @flow */ -import React, { useContext } from 'react'; +import { useContext } from 'react'; import { ThemeContext } from '../iframeScript'; import type { Theme } from '../styles'; diff --git a/packages/react-error-overlay/src/containers/CompileErrorContainer.js b/packages/react-error-overlay/src/containers/CompileErrorContainer.js index b0b91e5915..ccb3f4c6b5 100644 --- a/packages/react-error-overlay/src/containers/CompileErrorContainer.js +++ b/packages/react-error-overlay/src/containers/CompileErrorContainer.js @@ -6,7 +6,7 @@ */ /* @flow */ -import React, { useContext } from 'react'; +import { useContext } from 'react'; import { ThemeContext } from '../iframeScript'; import ErrorOverlay from '../components/ErrorOverlay'; import Footer from '../components/Footer'; diff --git a/packages/react-error-overlay/src/containers/RuntimeError.js b/packages/react-error-overlay/src/containers/RuntimeError.js index 1db2aba79b..4db494299c 100644 --- a/packages/react-error-overlay/src/containers/RuntimeError.js +++ b/packages/react-error-overlay/src/containers/RuntimeError.js @@ -6,7 +6,6 @@ */ /* @flow */ -import React from 'react'; import Header from '../components/Header'; import StackTrace from './StackTrace'; diff --git a/packages/react-error-overlay/src/containers/RuntimeErrorContainer.js b/packages/react-error-overlay/src/containers/RuntimeErrorContainer.js index bd6ba24d72..850a202917 100644 --- a/packages/react-error-overlay/src/containers/RuntimeErrorContainer.js +++ b/packages/react-error-overlay/src/containers/RuntimeErrorContainer.js @@ -6,7 +6,7 @@ */ /* @flow */ -import React, { PureComponent } from 'react'; +import { PureComponent } from 'react'; import ErrorOverlay from '../components/ErrorOverlay'; import CloseButton from '../components/CloseButton'; import NavigationBar from '../components/NavigationBar'; diff --git a/packages/react-error-overlay/src/containers/StackFrame.js b/packages/react-error-overlay/src/containers/StackFrame.js index 527cd41c10..f621b53ad0 100644 --- a/packages/react-error-overlay/src/containers/StackFrame.js +++ b/packages/react-error-overlay/src/containers/StackFrame.js @@ -6,7 +6,7 @@ */ /* @flow */ -import React, { useState, useContext } from 'react'; +import { useState, useContext } from 'react'; import { ThemeContext } from '../iframeScript'; import CodeBlock from './StackFrameCodeBlock'; import { getPrettyURL } from '../utils/getPrettyURL'; diff --git a/packages/react-error-overlay/src/containers/StackFrameCodeBlock.js b/packages/react-error-overlay/src/containers/StackFrameCodeBlock.js index 9b4242e6a8..f75ec37f38 100644 --- a/packages/react-error-overlay/src/containers/StackFrameCodeBlock.js +++ b/packages/react-error-overlay/src/containers/StackFrameCodeBlock.js @@ -6,7 +6,7 @@ */ /* @flow */ -import React, { useContext } from 'react'; +import { useContext } from 'react'; import { ThemeContext } from '../iframeScript'; import CodeBlock from '../components/CodeBlock'; import { absolutifyCaret } from '../utils/dom/absolutifyCaret'; diff --git a/packages/react-error-overlay/src/containers/StackTrace.js b/packages/react-error-overlay/src/containers/StackTrace.js index abec286a30..d48e95130b 100644 --- a/packages/react-error-overlay/src/containers/StackTrace.js +++ b/packages/react-error-overlay/src/containers/StackTrace.js @@ -6,7 +6,7 @@ */ /* @flow */ -import React, { Component } from 'react'; +import { Component } from 'react'; import StackFrame from './StackFrame'; import Collapsible from '../components/Collapsible'; import { isInternalFile } from '../utils/isInternalFile'; diff --git a/packages/react-error-overlay/src/iframeScript.js b/packages/react-error-overlay/src/iframeScript.js index dfad5ce201..73863e0686 100644 --- a/packages/react-error-overlay/src/iframeScript.js +++ b/packages/react-error-overlay/src/iframeScript.js @@ -6,7 +6,7 @@ */ import 'react-app-polyfill/ie9'; -import React, { createContext } from 'react'; +import { createContext } from 'react'; import ReactDOM from 'react-dom'; import CompileErrorContainer from './containers/CompileErrorContainer'; import RuntimeErrorContainer from './containers/RuntimeErrorContainer'; diff --git a/packages/react-scripts/fixtures/kitchensink/template/src/App.js b/packages/react-scripts/fixtures/kitchensink/template/src/App.js index c9d768f28d..0e6e395a86 100644 --- a/packages/react-scripts/fixtures/kitchensink/template/src/App.js +++ b/packages/react-scripts/fixtures/kitchensink/template/src/App.js @@ -5,7 +5,7 @@ * LICENSE file in the root directory of this source tree. */ -import React, { Component, createElement } from 'react'; +import { Component, createElement } from 'react'; import PropTypes from 'prop-types'; class BuiltEmitter extends Component { diff --git a/packages/react-scripts/fixtures/kitchensink/template/src/features/config/BaseUrl.js b/packages/react-scripts/fixtures/kitchensink/template/src/features/config/BaseUrl.js index 8a4c55a92e..50e2a42e11 100644 --- a/packages/react-scripts/fixtures/kitchensink/template/src/features/config/BaseUrl.js +++ b/packages/react-scripts/fixtures/kitchensink/template/src/features/config/BaseUrl.js @@ -5,7 +5,7 @@ * LICENSE file in the root directory of this source tree. */ -import React, { Component } from 'react'; +import { Component } from 'react'; import PropTypes from 'prop-types'; import load from 'absoluteLoad'; diff --git a/packages/react-scripts/fixtures/kitchensink/template/src/features/config/BaseUrl.test.js b/packages/react-scripts/fixtures/kitchensink/template/src/features/config/BaseUrl.test.js index aa8ddc396f..4d8c57294f 100644 --- a/packages/react-scripts/fixtures/kitchensink/template/src/features/config/BaseUrl.test.js +++ b/packages/react-scripts/fixtures/kitchensink/template/src/features/config/BaseUrl.test.js @@ -5,7 +5,6 @@ * LICENSE file in the root directory of this source tree. */ -import React from 'react'; import ReactDOM from 'react-dom'; import NodePath from './BaseUrl'; diff --git a/packages/react-scripts/fixtures/kitchensink/template/src/features/env/ExpandEnvVariables.js b/packages/react-scripts/fixtures/kitchensink/template/src/features/env/ExpandEnvVariables.js index f364ed1d93..cbaf7bcf3d 100644 --- a/packages/react-scripts/fixtures/kitchensink/template/src/features/env/ExpandEnvVariables.js +++ b/packages/react-scripts/fixtures/kitchensink/template/src/features/env/ExpandEnvVariables.js @@ -5,8 +5,6 @@ * LICENSE file in the root directory of this source tree. */ -import React from 'react'; - const ExpandEnvVariables = () => ( {process.env.REACT_APP_BASIC} diff --git a/packages/react-scripts/fixtures/kitchensink/template/src/features/env/ExpandEnvVariables.test.js b/packages/react-scripts/fixtures/kitchensink/template/src/features/env/ExpandEnvVariables.test.js index 4e4200abee..48dbb02a80 100644 --- a/packages/react-scripts/fixtures/kitchensink/template/src/features/env/ExpandEnvVariables.test.js +++ b/packages/react-scripts/fixtures/kitchensink/template/src/features/env/ExpandEnvVariables.test.js @@ -5,7 +5,6 @@ * LICENSE file in the root directory of this source tree. */ -import React from 'react'; import ReactDOM from 'react-dom'; import ExpandEnvVariables from './ExpandEnvVariables'; diff --git a/packages/react-scripts/fixtures/kitchensink/template/src/features/env/FileEnvVariables.js b/packages/react-scripts/fixtures/kitchensink/template/src/features/env/FileEnvVariables.js index 7855d7ac5e..6bf46048a2 100644 --- a/packages/react-scripts/fixtures/kitchensink/template/src/features/env/FileEnvVariables.js +++ b/packages/react-scripts/fixtures/kitchensink/template/src/features/env/FileEnvVariables.js @@ -5,8 +5,6 @@ * LICENSE file in the root directory of this source tree. */ -import React from 'react'; - const FileEnvVariables = () => ( diff --git a/packages/react-scripts/fixtures/kitchensink/template/src/features/env/FileEnvVariables.test.js b/packages/react-scripts/fixtures/kitchensink/template/src/features/env/FileEnvVariables.test.js index 8c628d2154..14100b9528 100644 --- a/packages/react-scripts/fixtures/kitchensink/template/src/features/env/FileEnvVariables.test.js +++ b/packages/react-scripts/fixtures/kitchensink/template/src/features/env/FileEnvVariables.test.js @@ -5,7 +5,6 @@ * LICENSE file in the root directory of this source tree. */ -import React from 'react'; import ReactDOM from 'react-dom'; import FileEnvVariables from './FileEnvVariables'; diff --git a/packages/react-scripts/fixtures/kitchensink/template/src/features/env/PublicUrl.js b/packages/react-scripts/fixtures/kitchensink/template/src/features/env/PublicUrl.js index 6b8891f9f4..e9236d99e6 100644 --- a/packages/react-scripts/fixtures/kitchensink/template/src/features/env/PublicUrl.js +++ b/packages/react-scripts/fixtures/kitchensink/template/src/features/env/PublicUrl.js @@ -5,8 +5,6 @@ * LICENSE file in the root directory of this source tree. */ -import React from 'react'; - const PublicUrl = () => ( {process.env.PUBLIC_URL}. ); diff --git a/packages/react-scripts/fixtures/kitchensink/template/src/features/env/PublicUrl.test.js b/packages/react-scripts/fixtures/kitchensink/template/src/features/env/PublicUrl.test.js index bda2e051fb..985cfb836f 100644 --- a/packages/react-scripts/fixtures/kitchensink/template/src/features/env/PublicUrl.test.js +++ b/packages/react-scripts/fixtures/kitchensink/template/src/features/env/PublicUrl.test.js @@ -5,7 +5,6 @@ * LICENSE file in the root directory of this source tree. */ -import React from 'react'; import ReactDOM from 'react-dom'; import PublicUrl from './PublicUrl'; diff --git a/packages/react-scripts/fixtures/kitchensink/template/src/features/env/ShellEnvVariables.js b/packages/react-scripts/fixtures/kitchensink/template/src/features/env/ShellEnvVariables.js index 72380484b6..5923fadcfa 100644 --- a/packages/react-scripts/fixtures/kitchensink/template/src/features/env/ShellEnvVariables.js +++ b/packages/react-scripts/fixtures/kitchensink/template/src/features/env/ShellEnvVariables.js @@ -5,8 +5,6 @@ * LICENSE file in the root directory of this source tree. */ -import React from 'react'; - const ShellEnvVariables = () => ( {process.env.REACT_APP_SHELL_ENV_MESSAGE}. diff --git a/packages/react-scripts/fixtures/kitchensink/template/src/features/env/ShellEnvVariables.test.js b/packages/react-scripts/fixtures/kitchensink/template/src/features/env/ShellEnvVariables.test.js index c1f5001cd8..972bb64729 100644 --- a/packages/react-scripts/fixtures/kitchensink/template/src/features/env/ShellEnvVariables.test.js +++ b/packages/react-scripts/fixtures/kitchensink/template/src/features/env/ShellEnvVariables.test.js @@ -5,7 +5,6 @@ * LICENSE file in the root directory of this source tree. */ -import React from 'react'; import ReactDOM from 'react-dom'; import ShellEnvVariables from './ShellEnvVariables'; diff --git a/packages/react-scripts/fixtures/kitchensink/template/src/features/syntax/ArrayDestructuring.js b/packages/react-scripts/fixtures/kitchensink/template/src/features/syntax/ArrayDestructuring.js index 4a27c0c019..60e27bcbf5 100644 --- a/packages/react-scripts/fixtures/kitchensink/template/src/features/syntax/ArrayDestructuring.js +++ b/packages/react-scripts/fixtures/kitchensink/template/src/features/syntax/ArrayDestructuring.js @@ -5,7 +5,7 @@ * LICENSE file in the root directory of this source tree. */ -import React, { Component } from 'react'; +import { Component } from 'react'; import PropTypes from 'prop-types'; function load() { diff --git a/packages/react-scripts/fixtures/kitchensink/template/src/features/syntax/ArrayDestructuring.test.js b/packages/react-scripts/fixtures/kitchensink/template/src/features/syntax/ArrayDestructuring.test.js index e6ab4c9f21..2c1c624a55 100644 --- a/packages/react-scripts/fixtures/kitchensink/template/src/features/syntax/ArrayDestructuring.test.js +++ b/packages/react-scripts/fixtures/kitchensink/template/src/features/syntax/ArrayDestructuring.test.js @@ -5,7 +5,6 @@ * LICENSE file in the root directory of this source tree. */ -import React from 'react'; import ReactDOM from 'react-dom'; import ArrayDestructuring from './ArrayDestructuring'; diff --git a/packages/react-scripts/fixtures/kitchensink/template/src/features/syntax/ArraySpread.js b/packages/react-scripts/fixtures/kitchensink/template/src/features/syntax/ArraySpread.js index 268e800a33..2afab57440 100644 --- a/packages/react-scripts/fixtures/kitchensink/template/src/features/syntax/ArraySpread.js +++ b/packages/react-scripts/fixtures/kitchensink/template/src/features/syntax/ArraySpread.js @@ -5,7 +5,7 @@ * LICENSE file in the root directory of this source tree. */ -import React, { Component } from 'react'; +import { Component } from 'react'; import PropTypes from 'prop-types'; function load(users) { diff --git a/packages/react-scripts/fixtures/kitchensink/template/src/features/syntax/ArraySpread.test.js b/packages/react-scripts/fixtures/kitchensink/template/src/features/syntax/ArraySpread.test.js index 4827bc222f..fa7f845568 100644 --- a/packages/react-scripts/fixtures/kitchensink/template/src/features/syntax/ArraySpread.test.js +++ b/packages/react-scripts/fixtures/kitchensink/template/src/features/syntax/ArraySpread.test.js @@ -5,7 +5,6 @@ * LICENSE file in the root directory of this source tree. */ -import React from 'react'; import ReactDOM from 'react-dom'; import ArraySpread from './ArraySpread'; diff --git a/packages/react-scripts/fixtures/kitchensink/template/src/features/syntax/AsyncAwait.js b/packages/react-scripts/fixtures/kitchensink/template/src/features/syntax/AsyncAwait.js index f098b3f362..c588b173f7 100644 --- a/packages/react-scripts/fixtures/kitchensink/template/src/features/syntax/AsyncAwait.js +++ b/packages/react-scripts/fixtures/kitchensink/template/src/features/syntax/AsyncAwait.js @@ -1,11 +1,4 @@ -/** - * Copyright (c) 2015-present, Facebook, Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ - -import React, { Component } from 'react'; +import { Component } from 'react'; import PropTypes from 'prop-types'; async function load() { @@ -17,16 +10,9 @@ async function load() { ]; } -/* eslint-disable */ -// Regression test for https://github.com/facebook/create-react-app/issues/3055 -const x = async ( - /* prettier-ignore */ - y: void -) => { +const x = async (y: void) => { const z = await y; }; -/* eslint-enable */ - export default class AsyncAwait extends Component { static propTypes = { onReady: PropTypes.func.isRequired, diff --git a/packages/react-scripts/fixtures/kitchensink/template/src/features/syntax/AsyncAwait.test.js b/packages/react-scripts/fixtures/kitchensink/template/src/features/syntax/AsyncAwait.test.js index b056cb7057..88dae902d2 100644 --- a/packages/react-scripts/fixtures/kitchensink/template/src/features/syntax/AsyncAwait.test.js +++ b/packages/react-scripts/fixtures/kitchensink/template/src/features/syntax/AsyncAwait.test.js @@ -5,7 +5,6 @@ * LICENSE file in the root directory of this source tree. */ -import React from 'react'; import ReactDOM from 'react-dom'; import AsyncAwait from './AsyncAwait'; diff --git a/packages/react-scripts/fixtures/kitchensink/template/src/features/syntax/ClassProperties.js b/packages/react-scripts/fixtures/kitchensink/template/src/features/syntax/ClassProperties.js index 532c1fbe4d..89176b3208 100644 --- a/packages/react-scripts/fixtures/kitchensink/template/src/features/syntax/ClassProperties.js +++ b/packages/react-scripts/fixtures/kitchensink/template/src/features/syntax/ClassProperties.js @@ -5,7 +5,7 @@ * LICENSE file in the root directory of this source tree. */ -import React, { Component } from 'react'; +import { Component } from 'react'; import PropTypes from 'prop-types'; export default class ClassProperties extends Component { diff --git a/packages/react-scripts/fixtures/kitchensink/template/src/features/syntax/ClassProperties.test.js b/packages/react-scripts/fixtures/kitchensink/template/src/features/syntax/ClassProperties.test.js index 3ba3074a35..29f3331afa 100644 --- a/packages/react-scripts/fixtures/kitchensink/template/src/features/syntax/ClassProperties.test.js +++ b/packages/react-scripts/fixtures/kitchensink/template/src/features/syntax/ClassProperties.test.js @@ -5,7 +5,6 @@ * LICENSE file in the root directory of this source tree. */ -import React from 'react'; import ReactDOM from 'react-dom'; import ClassProperties from './ClassProperties'; diff --git a/packages/react-scripts/fixtures/kitchensink/template/src/features/syntax/ComputedProperties.js b/packages/react-scripts/fixtures/kitchensink/template/src/features/syntax/ComputedProperties.js index 4787dc1cd0..f88010676f 100644 --- a/packages/react-scripts/fixtures/kitchensink/template/src/features/syntax/ComputedProperties.js +++ b/packages/react-scripts/fixtures/kitchensink/template/src/features/syntax/ComputedProperties.js @@ -5,7 +5,7 @@ * LICENSE file in the root directory of this source tree. */ -import React, { Component } from 'react'; +import { Component } from 'react'; import PropTypes from 'prop-types'; function load(prefix) { diff --git a/packages/react-scripts/fixtures/kitchensink/template/src/features/syntax/ComputedProperties.test.js b/packages/react-scripts/fixtures/kitchensink/template/src/features/syntax/ComputedProperties.test.js index 0442a6bc14..4d3211a27a 100644 --- a/packages/react-scripts/fixtures/kitchensink/template/src/features/syntax/ComputedProperties.test.js +++ b/packages/react-scripts/fixtures/kitchensink/template/src/features/syntax/ComputedProperties.test.js @@ -5,7 +5,6 @@ * LICENSE file in the root directory of this source tree. */ -import React from 'react'; import ReactDOM from 'react-dom'; import ComputedProperties from './ComputedProperties'; diff --git a/packages/react-scripts/fixtures/kitchensink/template/src/features/syntax/CustomInterpolation.js b/packages/react-scripts/fixtures/kitchensink/template/src/features/syntax/CustomInterpolation.js index 79b40c0a92..afcb5026d3 100644 --- a/packages/react-scripts/fixtures/kitchensink/template/src/features/syntax/CustomInterpolation.js +++ b/packages/react-scripts/fixtures/kitchensink/template/src/features/syntax/CustomInterpolation.js @@ -5,7 +5,7 @@ * LICENSE file in the root directory of this source tree. */ -import React, { Component } from 'react'; +import { Component } from 'react'; import PropTypes from 'prop-types'; const styled = ([style]) => diff --git a/packages/react-scripts/fixtures/kitchensink/template/src/features/syntax/CustomInterpolation.test.js b/packages/react-scripts/fixtures/kitchensink/template/src/features/syntax/CustomInterpolation.test.js index 854f3cebd2..3d17f3eb25 100644 --- a/packages/react-scripts/fixtures/kitchensink/template/src/features/syntax/CustomInterpolation.test.js +++ b/packages/react-scripts/fixtures/kitchensink/template/src/features/syntax/CustomInterpolation.test.js @@ -5,7 +5,6 @@ * LICENSE file in the root directory of this source tree. */ -import React from 'react'; import ReactDOM from 'react-dom'; import CustomInterpolation from './CustomInterpolation'; diff --git a/packages/react-scripts/fixtures/kitchensink/template/src/features/syntax/DefaultParameters.js b/packages/react-scripts/fixtures/kitchensink/template/src/features/syntax/DefaultParameters.js index 0a72a0025d..043e3e13c1 100644 --- a/packages/react-scripts/fixtures/kitchensink/template/src/features/syntax/DefaultParameters.js +++ b/packages/react-scripts/fixtures/kitchensink/template/src/features/syntax/DefaultParameters.js @@ -5,7 +5,7 @@ * LICENSE file in the root directory of this source tree. */ -import React, { Component } from 'react'; +import { Component } from 'react'; import PropTypes from 'prop-types'; function load(id = 0) { diff --git a/packages/react-scripts/fixtures/kitchensink/template/src/features/syntax/DefaultParameters.test.js b/packages/react-scripts/fixtures/kitchensink/template/src/features/syntax/DefaultParameters.test.js index 71c255200a..109873a1c6 100644 --- a/packages/react-scripts/fixtures/kitchensink/template/src/features/syntax/DefaultParameters.test.js +++ b/packages/react-scripts/fixtures/kitchensink/template/src/features/syntax/DefaultParameters.test.js @@ -5,7 +5,6 @@ * LICENSE file in the root directory of this source tree. */ -import React from 'react'; import ReactDOM from 'react-dom'; import DefaultParameters from './DefaultParameters'; diff --git a/packages/react-scripts/fixtures/kitchensink/template/src/features/syntax/DestructuringAndAwait.js b/packages/react-scripts/fixtures/kitchensink/template/src/features/syntax/DestructuringAndAwait.js index bd6d2bd6cd..0522f92e70 100644 --- a/packages/react-scripts/fixtures/kitchensink/template/src/features/syntax/DestructuringAndAwait.js +++ b/packages/react-scripts/fixtures/kitchensink/template/src/features/syntax/DestructuringAndAwait.js @@ -5,7 +5,7 @@ * LICENSE file in the root directory of this source tree. */ -import React, { Component } from 'react'; +import { Component } from 'react'; import PropTypes from 'prop-types'; async function load() { diff --git a/packages/react-scripts/fixtures/kitchensink/template/src/features/syntax/DestructuringAndAwait.test.js b/packages/react-scripts/fixtures/kitchensink/template/src/features/syntax/DestructuringAndAwait.test.js index ec9a9a9e1a..3d760d8f5e 100644 --- a/packages/react-scripts/fixtures/kitchensink/template/src/features/syntax/DestructuringAndAwait.test.js +++ b/packages/react-scripts/fixtures/kitchensink/template/src/features/syntax/DestructuringAndAwait.test.js @@ -5,7 +5,6 @@ * LICENSE file in the root directory of this source tree. */ -import React from 'react'; import ReactDOM from 'react-dom'; import DestructuringAndAwait from './DestructuringAndAwait'; diff --git a/packages/react-scripts/fixtures/kitchensink/template/src/features/syntax/Generators.js b/packages/react-scripts/fixtures/kitchensink/template/src/features/syntax/Generators.js index a6ca041eaa..085f458353 100644 --- a/packages/react-scripts/fixtures/kitchensink/template/src/features/syntax/Generators.js +++ b/packages/react-scripts/fixtures/kitchensink/template/src/features/syntax/Generators.js @@ -5,7 +5,7 @@ * LICENSE file in the root directory of this source tree. */ -import React, { Component } from 'react'; +import { Component } from 'react'; import PropTypes from 'prop-types'; function* load(limit) { diff --git a/packages/react-scripts/fixtures/kitchensink/template/src/features/syntax/Generators.test.js b/packages/react-scripts/fixtures/kitchensink/template/src/features/syntax/Generators.test.js index 5b59d66640..763bade983 100644 --- a/packages/react-scripts/fixtures/kitchensink/template/src/features/syntax/Generators.test.js +++ b/packages/react-scripts/fixtures/kitchensink/template/src/features/syntax/Generators.test.js @@ -5,7 +5,6 @@ * LICENSE file in the root directory of this source tree. */ -import React from 'react'; import ReactDOM from 'react-dom'; import Generators from './Generators'; diff --git a/packages/react-scripts/fixtures/kitchensink/template/src/features/syntax/NullishCoalescing.js b/packages/react-scripts/fixtures/kitchensink/template/src/features/syntax/NullishCoalescing.js index a514352f45..1dd814ec90 100644 --- a/packages/react-scripts/fixtures/kitchensink/template/src/features/syntax/NullishCoalescing.js +++ b/packages/react-scripts/fixtures/kitchensink/template/src/features/syntax/NullishCoalescing.js @@ -5,7 +5,7 @@ * LICENSE file in the root directory of this source tree. */ -import React, { Component } from 'react'; +import { Component } from 'react'; import PropTypes from 'prop-types'; function load() { diff --git a/packages/react-scripts/fixtures/kitchensink/template/src/features/syntax/NullishCoalescing.test.js b/packages/react-scripts/fixtures/kitchensink/template/src/features/syntax/NullishCoalescing.test.js index 781896da29..fe46066171 100644 --- a/packages/react-scripts/fixtures/kitchensink/template/src/features/syntax/NullishCoalescing.test.js +++ b/packages/react-scripts/fixtures/kitchensink/template/src/features/syntax/NullishCoalescing.test.js @@ -5,7 +5,6 @@ * LICENSE file in the root directory of this source tree. */ -import React from 'react'; import ReactDOM from 'react-dom'; import NullishCoalescing from './NullishCoalescing'; diff --git a/packages/react-scripts/fixtures/kitchensink/template/src/features/syntax/ObjectDestructuring.js b/packages/react-scripts/fixtures/kitchensink/template/src/features/syntax/ObjectDestructuring.js index 487c546166..f1039c8bb8 100644 --- a/packages/react-scripts/fixtures/kitchensink/template/src/features/syntax/ObjectDestructuring.js +++ b/packages/react-scripts/fixtures/kitchensink/template/src/features/syntax/ObjectDestructuring.js @@ -5,7 +5,7 @@ * LICENSE file in the root directory of this source tree. */ -import React, { Component } from 'react'; +import { Component } from 'react'; import PropTypes from 'prop-types'; function load() { diff --git a/packages/react-scripts/fixtures/kitchensink/template/src/features/syntax/ObjectDestructuring.test.js b/packages/react-scripts/fixtures/kitchensink/template/src/features/syntax/ObjectDestructuring.test.js index ea2b4bdc7a..63be41d9bf 100644 --- a/packages/react-scripts/fixtures/kitchensink/template/src/features/syntax/ObjectDestructuring.test.js +++ b/packages/react-scripts/fixtures/kitchensink/template/src/features/syntax/ObjectDestructuring.test.js @@ -5,7 +5,6 @@ * LICENSE file in the root directory of this source tree. */ -import React from 'react'; import ReactDOM from 'react-dom'; import ObjectDestructuring from './ObjectDestructuring'; diff --git a/packages/react-scripts/fixtures/kitchensink/template/src/features/syntax/ObjectSpread.js b/packages/react-scripts/fixtures/kitchensink/template/src/features/syntax/ObjectSpread.js index d1fda91b19..7bd7f8a17b 100644 --- a/packages/react-scripts/fixtures/kitchensink/template/src/features/syntax/ObjectSpread.js +++ b/packages/react-scripts/fixtures/kitchensink/template/src/features/syntax/ObjectSpread.js @@ -5,7 +5,7 @@ * LICENSE file in the root directory of this source tree. */ -import React, { Component } from 'react'; +import { Component } from 'react'; import PropTypes from 'prop-types'; function load(baseUser) { diff --git a/packages/react-scripts/fixtures/kitchensink/template/src/features/syntax/ObjectSpread.test.js b/packages/react-scripts/fixtures/kitchensink/template/src/features/syntax/ObjectSpread.test.js index 0f2aefd4e9..ce3543bf77 100644 --- a/packages/react-scripts/fixtures/kitchensink/template/src/features/syntax/ObjectSpread.test.js +++ b/packages/react-scripts/fixtures/kitchensink/template/src/features/syntax/ObjectSpread.test.js @@ -5,7 +5,6 @@ * LICENSE file in the root directory of this source tree. */ -import React from 'react'; import ReactDOM from 'react-dom'; import ObjectSpread from './ObjectSpread'; diff --git a/packages/react-scripts/fixtures/kitchensink/template/src/features/syntax/OptionalChaining.js b/packages/react-scripts/fixtures/kitchensink/template/src/features/syntax/OptionalChaining.js index 1274eff76d..cbded9f96a 100644 --- a/packages/react-scripts/fixtures/kitchensink/template/src/features/syntax/OptionalChaining.js +++ b/packages/react-scripts/fixtures/kitchensink/template/src/features/syntax/OptionalChaining.js @@ -5,7 +5,7 @@ * LICENSE file in the root directory of this source tree. */ -import React, { Component } from 'react'; +import { Component } from 'react'; import PropTypes from 'prop-types'; function load() { diff --git a/packages/react-scripts/fixtures/kitchensink/template/src/features/syntax/OptionalChaining.test.js b/packages/react-scripts/fixtures/kitchensink/template/src/features/syntax/OptionalChaining.test.js index 229037c6de..85a8825be4 100644 --- a/packages/react-scripts/fixtures/kitchensink/template/src/features/syntax/OptionalChaining.test.js +++ b/packages/react-scripts/fixtures/kitchensink/template/src/features/syntax/OptionalChaining.test.js @@ -5,7 +5,6 @@ * LICENSE file in the root directory of this source tree. */ -import React from 'react'; import ReactDOM from 'react-dom'; import OptionalChaining from './OptionalChaining'; diff --git a/packages/react-scripts/fixtures/kitchensink/template/src/features/syntax/Promises.js b/packages/react-scripts/fixtures/kitchensink/template/src/features/syntax/Promises.js index 01b2c513b1..b8650513ea 100644 --- a/packages/react-scripts/fixtures/kitchensink/template/src/features/syntax/Promises.js +++ b/packages/react-scripts/fixtures/kitchensink/template/src/features/syntax/Promises.js @@ -5,7 +5,7 @@ * LICENSE file in the root directory of this source tree. */ -import React, { Component } from 'react'; +import { Component } from 'react'; import PropTypes from 'prop-types'; function load() { diff --git a/packages/react-scripts/fixtures/kitchensink/template/src/features/syntax/Promises.test.js b/packages/react-scripts/fixtures/kitchensink/template/src/features/syntax/Promises.test.js index ee2ce709fb..6178ef894f 100644 --- a/packages/react-scripts/fixtures/kitchensink/template/src/features/syntax/Promises.test.js +++ b/packages/react-scripts/fixtures/kitchensink/template/src/features/syntax/Promises.test.js @@ -5,7 +5,6 @@ * LICENSE file in the root directory of this source tree. */ -import React from 'react'; import ReactDOM from 'react-dom'; describe('promises', () => { diff --git a/packages/react-scripts/fixtures/kitchensink/template/src/features/syntax/RestAndDefault.js b/packages/react-scripts/fixtures/kitchensink/template/src/features/syntax/RestAndDefault.js index 5fa8a8a0bb..a323b8a022 100644 --- a/packages/react-scripts/fixtures/kitchensink/template/src/features/syntax/RestAndDefault.js +++ b/packages/react-scripts/fixtures/kitchensink/template/src/features/syntax/RestAndDefault.js @@ -5,7 +5,7 @@ * LICENSE file in the root directory of this source tree. */ -import React, { Component } from 'react'; +import { Component } from 'react'; import PropTypes from 'prop-types'; function load({ id, ...rest } = { id: 0, user: { id: 42, name: '42' } }) { diff --git a/packages/react-scripts/fixtures/kitchensink/template/src/features/syntax/RestAndDefault.test.js b/packages/react-scripts/fixtures/kitchensink/template/src/features/syntax/RestAndDefault.test.js index 36fc91d4c2..1ab4155533 100644 --- a/packages/react-scripts/fixtures/kitchensink/template/src/features/syntax/RestAndDefault.test.js +++ b/packages/react-scripts/fixtures/kitchensink/template/src/features/syntax/RestAndDefault.test.js @@ -5,7 +5,6 @@ * LICENSE file in the root directory of this source tree. */ -import React from 'react'; import ReactDOM from 'react-dom'; import RestAndDefault from './RestAndDefault'; diff --git a/packages/react-scripts/fixtures/kitchensink/template/src/features/syntax/RestParameters.js b/packages/react-scripts/fixtures/kitchensink/template/src/features/syntax/RestParameters.js index 2080245c16..208dbb9871 100644 --- a/packages/react-scripts/fixtures/kitchensink/template/src/features/syntax/RestParameters.js +++ b/packages/react-scripts/fixtures/kitchensink/template/src/features/syntax/RestParameters.js @@ -5,7 +5,7 @@ * LICENSE file in the root directory of this source tree. */ -import React, { Component } from 'react'; +import { Component } from 'react'; import PropTypes from 'prop-types'; function load({ id = 0, ...rest }) { diff --git a/packages/react-scripts/fixtures/kitchensink/template/src/features/syntax/RestParameters.test.js b/packages/react-scripts/fixtures/kitchensink/template/src/features/syntax/RestParameters.test.js index 9be970124a..f314a4b4f1 100644 --- a/packages/react-scripts/fixtures/kitchensink/template/src/features/syntax/RestParameters.test.js +++ b/packages/react-scripts/fixtures/kitchensink/template/src/features/syntax/RestParameters.test.js @@ -5,7 +5,6 @@ * LICENSE file in the root directory of this source tree. */ -import React from 'react'; import ReactDOM from 'react-dom'; import RestParameters from './RestParameters'; diff --git a/packages/react-scripts/fixtures/kitchensink/template/src/features/syntax/TemplateInterpolation.js b/packages/react-scripts/fixtures/kitchensink/template/src/features/syntax/TemplateInterpolation.js index da80f7fff6..6d29f098ce 100644 --- a/packages/react-scripts/fixtures/kitchensink/template/src/features/syntax/TemplateInterpolation.js +++ b/packages/react-scripts/fixtures/kitchensink/template/src/features/syntax/TemplateInterpolation.js @@ -5,7 +5,7 @@ * LICENSE file in the root directory of this source tree. */ -import React, { Component } from 'react'; +import { Component } from 'react'; import PropTypes from 'prop-types'; function load(name) { diff --git a/packages/react-scripts/fixtures/kitchensink/template/src/features/syntax/TemplateInterpolation.test.js b/packages/react-scripts/fixtures/kitchensink/template/src/features/syntax/TemplateInterpolation.test.js index 10082088de..b61853d45c 100644 --- a/packages/react-scripts/fixtures/kitchensink/template/src/features/syntax/TemplateInterpolation.test.js +++ b/packages/react-scripts/fixtures/kitchensink/template/src/features/syntax/TemplateInterpolation.test.js @@ -5,7 +5,6 @@ * LICENSE file in the root directory of this source tree. */ -import React from 'react'; import ReactDOM from 'react-dom'; import TemplateInterpolation from './TemplateInterpolation'; diff --git a/packages/react-scripts/fixtures/kitchensink/template/src/features/webpack/CssInclusion.js b/packages/react-scripts/fixtures/kitchensink/template/src/features/webpack/CssInclusion.js index 71fa17890b..fdbd9b47b1 100644 --- a/packages/react-scripts/fixtures/kitchensink/template/src/features/webpack/CssInclusion.js +++ b/packages/react-scripts/fixtures/kitchensink/template/src/features/webpack/CssInclusion.js @@ -5,7 +5,6 @@ * LICENSE file in the root directory of this source tree. */ -import React from 'react'; import './assets/style.css'; const CssInclusion = () => ( diff --git a/packages/react-scripts/fixtures/kitchensink/template/src/features/webpack/CssInclusion.test.js b/packages/react-scripts/fixtures/kitchensink/template/src/features/webpack/CssInclusion.test.js index 7d85a6024a..1fc5ab7485 100644 --- a/packages/react-scripts/fixtures/kitchensink/template/src/features/webpack/CssInclusion.test.js +++ b/packages/react-scripts/fixtures/kitchensink/template/src/features/webpack/CssInclusion.test.js @@ -5,7 +5,6 @@ * LICENSE file in the root directory of this source tree. */ -import React from 'react'; import ReactDOM from 'react-dom'; import CssInclusion from './CssInclusion'; diff --git a/packages/react-scripts/fixtures/kitchensink/template/src/features/webpack/CssModulesInclusion.js b/packages/react-scripts/fixtures/kitchensink/template/src/features/webpack/CssModulesInclusion.js index e6175bfee7..28624298a1 100644 --- a/packages/react-scripts/fixtures/kitchensink/template/src/features/webpack/CssModulesInclusion.js +++ b/packages/react-scripts/fixtures/kitchensink/template/src/features/webpack/CssModulesInclusion.js @@ -5,7 +5,6 @@ * LICENSE file in the root directory of this source tree. */ -import React from 'react'; import styles from './assets/style.module.css'; import indexStyles from './assets/index.module.css'; diff --git a/packages/react-scripts/fixtures/kitchensink/template/src/features/webpack/CssModulesInclusion.test.js b/packages/react-scripts/fixtures/kitchensink/template/src/features/webpack/CssModulesInclusion.test.js index 6eae30fb85..02b1f36628 100644 --- a/packages/react-scripts/fixtures/kitchensink/template/src/features/webpack/CssModulesInclusion.test.js +++ b/packages/react-scripts/fixtures/kitchensink/template/src/features/webpack/CssModulesInclusion.test.js @@ -5,7 +5,6 @@ * LICENSE file in the root directory of this source tree. */ -import React from 'react'; import ReactDOM from 'react-dom'; import CssModulesInclusion from './CssModulesInclusion'; diff --git a/packages/react-scripts/fixtures/kitchensink/template/src/features/webpack/DynamicImport.js b/packages/react-scripts/fixtures/kitchensink/template/src/features/webpack/DynamicImport.js index 2651ab93db..450df4d5c3 100644 --- a/packages/react-scripts/fixtures/kitchensink/template/src/features/webpack/DynamicImport.js +++ b/packages/react-scripts/fixtures/kitchensink/template/src/features/webpack/DynamicImport.js @@ -5,8 +5,6 @@ * LICENSE file in the root directory of this source tree. */ -import React from 'react'; - const DynamicImport = () => { return <>Hello World!; }; diff --git a/packages/react-scripts/fixtures/kitchensink/template/src/features/webpack/DynamicImport.test.js b/packages/react-scripts/fixtures/kitchensink/template/src/features/webpack/DynamicImport.test.js index 0c7071b330..b229b2d332 100644 --- a/packages/react-scripts/fixtures/kitchensink/template/src/features/webpack/DynamicImport.test.js +++ b/packages/react-scripts/fixtures/kitchensink/template/src/features/webpack/DynamicImport.test.js @@ -5,7 +5,6 @@ * LICENSE file in the root directory of this source tree. */ -import React from 'react'; import ReactDOM from 'react-dom'; describe('dynamic import', () => { diff --git a/packages/react-scripts/fixtures/kitchensink/template/src/features/webpack/ImageInclusion.js b/packages/react-scripts/fixtures/kitchensink/template/src/features/webpack/ImageInclusion.js index 6c669339a5..776018337a 100644 --- a/packages/react-scripts/fixtures/kitchensink/template/src/features/webpack/ImageInclusion.js +++ b/packages/react-scripts/fixtures/kitchensink/template/src/features/webpack/ImageInclusion.js @@ -5,7 +5,6 @@ * LICENSE file in the root directory of this source tree. */ -import React from 'react'; import tiniestCat from './assets/tiniest-cat.jpg'; const ImageInclusion = () => ( diff --git a/packages/react-scripts/fixtures/kitchensink/template/src/features/webpack/ImageInclusion.test.js b/packages/react-scripts/fixtures/kitchensink/template/src/features/webpack/ImageInclusion.test.js index ffe9cafbcc..435f3124aa 100644 --- a/packages/react-scripts/fixtures/kitchensink/template/src/features/webpack/ImageInclusion.test.js +++ b/packages/react-scripts/fixtures/kitchensink/template/src/features/webpack/ImageInclusion.test.js @@ -5,7 +5,6 @@ * LICENSE file in the root directory of this source tree. */ -import React from 'react'; import ReactDOM from 'react-dom'; import ImageInclusion from './ImageInclusion'; diff --git a/packages/react-scripts/fixtures/kitchensink/template/src/features/webpack/JsonInclusion.js b/packages/react-scripts/fixtures/kitchensink/template/src/features/webpack/JsonInclusion.js index 97f782f515..f19839a3ea 100644 --- a/packages/react-scripts/fixtures/kitchensink/template/src/features/webpack/JsonInclusion.js +++ b/packages/react-scripts/fixtures/kitchensink/template/src/features/webpack/JsonInclusion.js @@ -5,7 +5,6 @@ * LICENSE file in the root directory of this source tree. */ -import React from 'react'; import { abstract } from './assets/abstract.json'; const JsonInclusion = () => ( diff --git a/packages/react-scripts/fixtures/kitchensink/template/src/features/webpack/JsonInclusion.test.js b/packages/react-scripts/fixtures/kitchensink/template/src/features/webpack/JsonInclusion.test.js index 42f458df1a..824c6d26d1 100644 --- a/packages/react-scripts/fixtures/kitchensink/template/src/features/webpack/JsonInclusion.test.js +++ b/packages/react-scripts/fixtures/kitchensink/template/src/features/webpack/JsonInclusion.test.js @@ -5,7 +5,6 @@ * LICENSE file in the root directory of this source tree. */ -import React from 'react'; import ReactDOM from 'react-dom'; import JsonInclusion from './JsonInclusion'; diff --git a/packages/react-scripts/fixtures/kitchensink/template/src/features/webpack/LinkedModules.js b/packages/react-scripts/fixtures/kitchensink/template/src/features/webpack/LinkedModules.js index a19091f6e3..f5fad73fc9 100644 --- a/packages/react-scripts/fixtures/kitchensink/template/src/features/webpack/LinkedModules.js +++ b/packages/react-scripts/fixtures/kitchensink/template/src/features/webpack/LinkedModules.js @@ -5,7 +5,6 @@ * LICENSE file in the root directory of this source tree. */ -import React from 'react'; import './assets/style.css'; import { test, version } from 'test-integrity'; diff --git a/packages/react-scripts/fixtures/kitchensink/template/src/features/webpack/LinkedModules.test.js b/packages/react-scripts/fixtures/kitchensink/template/src/features/webpack/LinkedModules.test.js index b850c2aa88..601884fe86 100644 --- a/packages/react-scripts/fixtures/kitchensink/template/src/features/webpack/LinkedModules.test.js +++ b/packages/react-scripts/fixtures/kitchensink/template/src/features/webpack/LinkedModules.test.js @@ -5,7 +5,6 @@ * LICENSE file in the root directory of this source tree. */ -import React from 'react'; import ReactDOM from 'react-dom'; import { test, version } from 'test-integrity'; import LinkedModules from './LinkedModules'; diff --git a/packages/react-scripts/fixtures/kitchensink/template/src/features/webpack/NoExtInclusion.js b/packages/react-scripts/fixtures/kitchensink/template/src/features/webpack/NoExtInclusion.js index 3b02085113..d9e5c4621f 100644 --- a/packages/react-scripts/fixtures/kitchensink/template/src/features/webpack/NoExtInclusion.js +++ b/packages/react-scripts/fixtures/kitchensink/template/src/features/webpack/NoExtInclusion.js @@ -5,7 +5,6 @@ * LICENSE file in the root directory of this source tree. */ -import React from 'react'; import aFileWithoutExt from './assets/aFileWithoutExt'; const text = aFileWithoutExt.includes('base64') diff --git a/packages/react-scripts/fixtures/kitchensink/template/src/features/webpack/NoExtInclusion.test.js b/packages/react-scripts/fixtures/kitchensink/template/src/features/webpack/NoExtInclusion.test.js index 0d83b5f0c5..d34d88fa8f 100644 --- a/packages/react-scripts/fixtures/kitchensink/template/src/features/webpack/NoExtInclusion.test.js +++ b/packages/react-scripts/fixtures/kitchensink/template/src/features/webpack/NoExtInclusion.test.js @@ -5,7 +5,6 @@ * LICENSE file in the root directory of this source tree. */ -import React from 'react'; import ReactDOM from 'react-dom'; import NoExtInclusion from './NoExtInclusion'; diff --git a/packages/react-scripts/fixtures/kitchensink/template/src/features/webpack/SassInclusion.js b/packages/react-scripts/fixtures/kitchensink/template/src/features/webpack/SassInclusion.js index def7f4bbdf..d2e2386085 100644 --- a/packages/react-scripts/fixtures/kitchensink/template/src/features/webpack/SassInclusion.js +++ b/packages/react-scripts/fixtures/kitchensink/template/src/features/webpack/SassInclusion.js @@ -5,7 +5,6 @@ * LICENSE file in the root directory of this source tree. */ -import React from 'react'; import './assets/sass-styles.sass'; const SassInclusion = () => ( diff --git a/packages/react-scripts/fixtures/kitchensink/template/src/features/webpack/SassInclusion.test.js b/packages/react-scripts/fixtures/kitchensink/template/src/features/webpack/SassInclusion.test.js index c58080ab5b..290606526c 100644 --- a/packages/react-scripts/fixtures/kitchensink/template/src/features/webpack/SassInclusion.test.js +++ b/packages/react-scripts/fixtures/kitchensink/template/src/features/webpack/SassInclusion.test.js @@ -5,7 +5,6 @@ * LICENSE file in the root directory of this source tree. */ -import React from 'react'; import ReactDOM from 'react-dom'; import SassInclusion from './SassInclusion'; diff --git a/packages/react-scripts/fixtures/kitchensink/template/src/features/webpack/SassModulesInclusion.js b/packages/react-scripts/fixtures/kitchensink/template/src/features/webpack/SassModulesInclusion.js index ff7341d873..0416720adb 100644 --- a/packages/react-scripts/fixtures/kitchensink/template/src/features/webpack/SassModulesInclusion.js +++ b/packages/react-scripts/fixtures/kitchensink/template/src/features/webpack/SassModulesInclusion.js @@ -5,7 +5,6 @@ * LICENSE file in the root directory of this source tree. */ -import React from 'react'; import styles from './assets/sass-styles.module.sass'; import indexStyles from './assets/index.module.sass'; diff --git a/packages/react-scripts/fixtures/kitchensink/template/src/features/webpack/SassModulesInclusion.test.js b/packages/react-scripts/fixtures/kitchensink/template/src/features/webpack/SassModulesInclusion.test.js index 373330a5fa..0ca58ba50c 100644 --- a/packages/react-scripts/fixtures/kitchensink/template/src/features/webpack/SassModulesInclusion.test.js +++ b/packages/react-scripts/fixtures/kitchensink/template/src/features/webpack/SassModulesInclusion.test.js @@ -5,7 +5,6 @@ * LICENSE file in the root directory of this source tree. */ -import React from 'react'; import ReactDOM from 'react-dom'; import SassModulesInclusion from './SassModulesInclusion'; diff --git a/packages/react-scripts/fixtures/kitchensink/template/src/features/webpack/ScssInclusion.js b/packages/react-scripts/fixtures/kitchensink/template/src/features/webpack/ScssInclusion.js index 8c6a9d81bb..71739d5145 100644 --- a/packages/react-scripts/fixtures/kitchensink/template/src/features/webpack/ScssInclusion.js +++ b/packages/react-scripts/fixtures/kitchensink/template/src/features/webpack/ScssInclusion.js @@ -5,7 +5,6 @@ * LICENSE file in the root directory of this source tree. */ -import React from 'react'; import './assets/scss-styles.scss'; const ScssInclusion = () => ( diff --git a/packages/react-scripts/fixtures/kitchensink/template/src/features/webpack/ScssInclusion.test.js b/packages/react-scripts/fixtures/kitchensink/template/src/features/webpack/ScssInclusion.test.js index 81d49588ca..a9a059225f 100644 --- a/packages/react-scripts/fixtures/kitchensink/template/src/features/webpack/ScssInclusion.test.js +++ b/packages/react-scripts/fixtures/kitchensink/template/src/features/webpack/ScssInclusion.test.js @@ -5,7 +5,6 @@ * LICENSE file in the root directory of this source tree. */ -import React from 'react'; import ReactDOM from 'react-dom'; import ScssInclusion from './ScssInclusion'; diff --git a/packages/react-scripts/fixtures/kitchensink/template/src/features/webpack/ScssModulesInclusion.js b/packages/react-scripts/fixtures/kitchensink/template/src/features/webpack/ScssModulesInclusion.js index bfc0338a3c..3f277f9c21 100644 --- a/packages/react-scripts/fixtures/kitchensink/template/src/features/webpack/ScssModulesInclusion.js +++ b/packages/react-scripts/fixtures/kitchensink/template/src/features/webpack/ScssModulesInclusion.js @@ -5,7 +5,6 @@ * LICENSE file in the root directory of this source tree. */ -import React from 'react'; import styles from './assets/scss-styles.module.scss'; import indexStyles from './assets/index.module.scss'; diff --git a/packages/react-scripts/fixtures/kitchensink/template/src/features/webpack/ScssModulesInclusion.test.js b/packages/react-scripts/fixtures/kitchensink/template/src/features/webpack/ScssModulesInclusion.test.js index 5de5283966..cb8f2787ab 100644 --- a/packages/react-scripts/fixtures/kitchensink/template/src/features/webpack/ScssModulesInclusion.test.js +++ b/packages/react-scripts/fixtures/kitchensink/template/src/features/webpack/ScssModulesInclusion.test.js @@ -5,7 +5,6 @@ * LICENSE file in the root directory of this source tree. */ -import React from 'react'; import ReactDOM from 'react-dom'; import ScssModulesInclusion from './ScssModulesInclusion'; diff --git a/packages/react-scripts/fixtures/kitchensink/template/src/features/webpack/SvgComponent.js b/packages/react-scripts/fixtures/kitchensink/template/src/features/webpack/SvgComponent.js index d7d6dafeb3..0fda787703 100644 --- a/packages/react-scripts/fixtures/kitchensink/template/src/features/webpack/SvgComponent.js +++ b/packages/react-scripts/fixtures/kitchensink/template/src/features/webpack/SvgComponent.js @@ -5,7 +5,6 @@ * LICENSE file in the root directory of this source tree. */ -import React from 'react'; import { ReactComponent as Logo } from './assets/logo.svg'; const SvgComponent = () => { diff --git a/packages/react-scripts/fixtures/kitchensink/template/src/features/webpack/SvgComponent.test.js b/packages/react-scripts/fixtures/kitchensink/template/src/features/webpack/SvgComponent.test.js index 493a6bc87b..b8904f909b 100644 --- a/packages/react-scripts/fixtures/kitchensink/template/src/features/webpack/SvgComponent.test.js +++ b/packages/react-scripts/fixtures/kitchensink/template/src/features/webpack/SvgComponent.test.js @@ -5,7 +5,6 @@ * LICENSE file in the root directory of this source tree. */ -import React from 'react'; import ReactDOM from 'react-dom'; import SvgComponent, { SvgComponentWithRef } from './SvgComponent'; diff --git a/packages/react-scripts/fixtures/kitchensink/template/src/features/webpack/SvgInCss.js b/packages/react-scripts/fixtures/kitchensink/template/src/features/webpack/SvgInCss.js index ff9ff180da..2c5f9982fd 100644 --- a/packages/react-scripts/fixtures/kitchensink/template/src/features/webpack/SvgInCss.js +++ b/packages/react-scripts/fixtures/kitchensink/template/src/features/webpack/SvgInCss.js @@ -1,4 +1,3 @@ -import React from 'react'; import './assets/svg.css'; const SvgInCss = () =>
; diff --git a/packages/react-scripts/fixtures/kitchensink/template/src/features/webpack/SvgInCss.test.js b/packages/react-scripts/fixtures/kitchensink/template/src/features/webpack/SvgInCss.test.js index f0c0bd6837..7f69cdf870 100644 --- a/packages/react-scripts/fixtures/kitchensink/template/src/features/webpack/SvgInCss.test.js +++ b/packages/react-scripts/fixtures/kitchensink/template/src/features/webpack/SvgInCss.test.js @@ -1,4 +1,3 @@ -import React from 'react'; import ReactDOM from 'react-dom'; import SvgInCss from './SvgInCss'; diff --git a/packages/react-scripts/fixtures/kitchensink/template/src/features/webpack/SvgInclusion.js b/packages/react-scripts/fixtures/kitchensink/template/src/features/webpack/SvgInclusion.js index 7ef580c010..25b9ec3dbe 100644 --- a/packages/react-scripts/fixtures/kitchensink/template/src/features/webpack/SvgInclusion.js +++ b/packages/react-scripts/fixtures/kitchensink/template/src/features/webpack/SvgInclusion.js @@ -5,7 +5,6 @@ * LICENSE file in the root directory of this source tree. */ -import React from 'react'; import logo from './assets/logo.svg'; const SvgInclusion = () => ( diff --git a/packages/react-scripts/fixtures/kitchensink/template/src/features/webpack/SvgInclusion.test.js b/packages/react-scripts/fixtures/kitchensink/template/src/features/webpack/SvgInclusion.test.js index 4b6a9a686e..dabe299eca 100644 --- a/packages/react-scripts/fixtures/kitchensink/template/src/features/webpack/SvgInclusion.test.js +++ b/packages/react-scripts/fixtures/kitchensink/template/src/features/webpack/SvgInclusion.test.js @@ -5,7 +5,6 @@ * LICENSE file in the root directory of this source tree. */ -import React from 'react'; import ReactDOM from 'react-dom'; import SvgInclusion from './SvgInclusion'; diff --git a/packages/react-scripts/fixtures/kitchensink/template/src/features/webpack/UnknownExtInclusion.js b/packages/react-scripts/fixtures/kitchensink/template/src/features/webpack/UnknownExtInclusion.js index 1fe2720f56..7af2f4e69e 100644 --- a/packages/react-scripts/fixtures/kitchensink/template/src/features/webpack/UnknownExtInclusion.js +++ b/packages/react-scripts/fixtures/kitchensink/template/src/features/webpack/UnknownExtInclusion.js @@ -5,7 +5,6 @@ * LICENSE file in the root directory of this source tree. */ -import React from 'react'; import aFileWithExtUnknown from './assets/aFileWithExt.unknown'; const text = aFileWithExtUnknown.includes('base64') diff --git a/packages/react-scripts/fixtures/kitchensink/template/src/features/webpack/UnknownExtInclusion.test.js b/packages/react-scripts/fixtures/kitchensink/template/src/features/webpack/UnknownExtInclusion.test.js index 538240dae6..ecf8225860 100644 --- a/packages/react-scripts/fixtures/kitchensink/template/src/features/webpack/UnknownExtInclusion.test.js +++ b/packages/react-scripts/fixtures/kitchensink/template/src/features/webpack/UnknownExtInclusion.test.js @@ -5,7 +5,6 @@ * LICENSE file in the root directory of this source tree. */ -import React from 'react'; import ReactDOM from 'react-dom'; import UnknownExtInclusion from './UnknownExtInclusion'; diff --git a/packages/react-scripts/fixtures/kitchensink/template/src/index.js b/packages/react-scripts/fixtures/kitchensink/template/src/index.js index 5268eacecf..91a1575061 100644 --- a/packages/react-scripts/fixtures/kitchensink/template/src/index.js +++ b/packages/react-scripts/fixtures/kitchensink/template/src/index.js @@ -5,7 +5,6 @@ * LICENSE file in the root directory of this source tree. */ -import React from 'react'; import ReactDOM from 'react-dom'; import App from './App'; diff --git a/test/fixtures/boostrap-sass/src/index.js b/test/fixtures/boostrap-sass/src/index.js index 44f52927b5..30b6ccbe58 100644 --- a/test/fixtures/boostrap-sass/src/index.js +++ b/test/fixtures/boostrap-sass/src/index.js @@ -1,4 +1,3 @@ -import React from 'react'; import ReactDOM from 'react-dom'; import './index.sass'; diff --git a/test/fixtures/builds-with-multiple-runtimes/src/index.js b/test/fixtures/builds-with-multiple-runtimes/src/index.js index b0603469a8..cdaebe944f 100644 --- a/test/fixtures/builds-with-multiple-runtimes/src/index.js +++ b/test/fixtures/builds-with-multiple-runtimes/src/index.js @@ -1,4 +1,3 @@ -import React from 'react'; import dva from 'dva'; import createHistory from 'history/createHashHistory'; import ky from 'ky'; diff --git a/test/fixtures/global-scss-asset-resolution/src/index.js b/test/fixtures/global-scss-asset-resolution/src/index.js index 9fc16c21ff..3a21b717d4 100644 --- a/test/fixtures/global-scss-asset-resolution/src/index.js +++ b/test/fixtures/global-scss-asset-resolution/src/index.js @@ -1,4 +1,3 @@ -import React from 'react'; import ReactDOM from 'react-dom'; import './index.scss'; diff --git a/test/fixtures/jsconfig/src/App.js b/test/fixtures/jsconfig/src/App.js index 0dcfa10fc6..03cfe03c66 100644 --- a/test/fixtures/jsconfig/src/App.js +++ b/test/fixtures/jsconfig/src/App.js @@ -5,7 +5,7 @@ * LICENSE file in the root directory of this source tree. */ -import React, { Component } from 'react'; +import { Component } from 'react'; import PropTypes from 'prop-types'; import load from 'absoluteLoad'; diff --git a/test/fixtures/jsconfig/src/App.test.js b/test/fixtures/jsconfig/src/App.test.js index f70db9efc0..eba1d2b862 100644 --- a/test/fixtures/jsconfig/src/App.test.js +++ b/test/fixtures/jsconfig/src/App.test.js @@ -5,7 +5,6 @@ * LICENSE file in the root directory of this source tree. */ -import React from 'react'; import ReactDOM from 'react-dom'; import App from './App'; diff --git a/test/fixtures/jsconfig/src/index.js b/test/fixtures/jsconfig/src/index.js index b597a44232..606d7ac488 100644 --- a/test/fixtures/jsconfig/src/index.js +++ b/test/fixtures/jsconfig/src/index.js @@ -1,4 +1,3 @@ -import React from 'react'; import ReactDOM from 'react-dom'; import App from './App'; diff --git a/test/fixtures/mjs-support/src/App.js b/test/fixtures/mjs-support/src/App.js index 6b5321529d..123eed0858 100644 --- a/test/fixtures/mjs-support/src/App.js +++ b/test/fixtures/mjs-support/src/App.js @@ -1,4 +1,3 @@ -import React, { Component } from 'react'; import { graphql, GraphQLSchema, diff --git a/test/fixtures/mjs-support/src/index.js b/test/fixtures/mjs-support/src/index.js index b597a44232..606d7ac488 100644 --- a/test/fixtures/mjs-support/src/index.js +++ b/test/fixtures/mjs-support/src/index.js @@ -1,4 +1,3 @@ -import React from 'react'; import ReactDOM from 'react-dom'; import App from './App'; diff --git a/test/fixtures/webpack-message-formatting/src/AppAliasUnknownExport.js b/test/fixtures/webpack-message-formatting/src/AppAliasUnknownExport.js index df2716efc7..ec7531c3d4 100644 --- a/test/fixtures/webpack-message-formatting/src/AppAliasUnknownExport.js +++ b/test/fixtures/webpack-message-formatting/src/AppAliasUnknownExport.js @@ -1,4 +1,4 @@ -import React, { Component } from 'react'; +import { Component } from 'react'; import { bar as bar2 } from './AppUnknownExport'; class App extends Component { diff --git a/test/fixtures/webpack-message-formatting/src/AppBabel.js b/test/fixtures/webpack-message-formatting/src/AppBabel.js index b6799d38e5..42752c891e 100644 --- a/test/fixtures/webpack-message-formatting/src/AppBabel.js +++ b/test/fixtures/webpack-message-formatting/src/AppBabel.js @@ -1,4 +1,4 @@ -import React, { Component } from 'react'; +import { Component } from 'react'; class App extends Component { render() { diff --git a/test/fixtures/webpack-message-formatting/src/AppCss.js b/test/fixtures/webpack-message-formatting/src/AppCss.js index af04f1c60b..b1657908ae 100644 --- a/test/fixtures/webpack-message-formatting/src/AppCss.js +++ b/test/fixtures/webpack-message-formatting/src/AppCss.js @@ -1,4 +1,4 @@ -import React, { Component } from 'react'; +import { Component } from 'react'; import './AppCss.css'; class App extends Component { diff --git a/test/fixtures/webpack-message-formatting/src/AppIncorrectCase.js b/test/fixtures/webpack-message-formatting/src/AppIncorrectCase.js index 40f69d4393..2af97047f6 100644 --- a/test/fixtures/webpack-message-formatting/src/AppIncorrectCase.js +++ b/test/fixtures/webpack-message-formatting/src/AppIncorrectCase.js @@ -1,4 +1,4 @@ -import React, { Component } from 'react'; +import { Component } from 'react'; import five from './export5'; class App extends Component { diff --git a/test/fixtures/webpack-message-formatting/src/AppLintError.js b/test/fixtures/webpack-message-formatting/src/AppLintError.js index 6015c397d4..5dd6c2a956 100644 --- a/test/fixtures/webpack-message-formatting/src/AppLintError.js +++ b/test/fixtures/webpack-message-formatting/src/AppLintError.js @@ -1,4 +1,4 @@ -import React, { Component } from 'react'; +import { Component } from 'react'; function foo() { const a = b; diff --git a/test/fixtures/webpack-message-formatting/src/AppLintWarning.js b/test/fixtures/webpack-message-formatting/src/AppLintWarning.js index 0918e42b73..58c00a67df 100644 --- a/test/fixtures/webpack-message-formatting/src/AppLintWarning.js +++ b/test/fixtures/webpack-message-formatting/src/AppLintWarning.js @@ -1,4 +1,4 @@ -import React, { Component } from 'react'; +import { Component } from 'react'; function foo() {} diff --git a/test/fixtures/webpack-message-formatting/src/AppMissingPackage.js b/test/fixtures/webpack-message-formatting/src/AppMissingPackage.js index 5e62c96743..6219d6e767 100644 --- a/test/fixtures/webpack-message-formatting/src/AppMissingPackage.js +++ b/test/fixtures/webpack-message-formatting/src/AppMissingPackage.js @@ -1,4 +1,4 @@ -import React, { Component } from 'react'; +import { Component } from 'react'; import { bar } from 'unknown-package'; class App extends Component { diff --git a/test/fixtures/webpack-message-formatting/src/AppNoDefault.js b/test/fixtures/webpack-message-formatting/src/AppNoDefault.js index 9087eed49d..7a04293841 100644 --- a/test/fixtures/webpack-message-formatting/src/AppNoDefault.js +++ b/test/fixtures/webpack-message-formatting/src/AppNoDefault.js @@ -1,4 +1,4 @@ -import React, { Component } from 'react'; +import { Component } from 'react'; import myImport from './ExportNoDefault'; class App extends Component { diff --git a/test/fixtures/webpack-message-formatting/src/AppOutOfScopeImport.js b/test/fixtures/webpack-message-formatting/src/AppOutOfScopeImport.js index a8717e2308..3c422afb98 100644 --- a/test/fixtures/webpack-message-formatting/src/AppOutOfScopeImport.js +++ b/test/fixtures/webpack-message-formatting/src/AppOutOfScopeImport.js @@ -1,4 +1,4 @@ -import React, { Component } from 'react'; +import { Component } from 'react'; import myImport from '../OutOfScopeImport'; class App extends Component { diff --git a/test/fixtures/webpack-message-formatting/src/AppSass.js b/test/fixtures/webpack-message-formatting/src/AppSass.js index 20ac0e211a..529a0e5364 100644 --- a/test/fixtures/webpack-message-formatting/src/AppSass.js +++ b/test/fixtures/webpack-message-formatting/src/AppSass.js @@ -1,4 +1,4 @@ -import React, { Component } from 'react'; +import { Component } from 'react'; import './AppSass.scss'; class App extends Component { diff --git a/test/fixtures/webpack-message-formatting/src/AppUnknownExport.js b/test/fixtures/webpack-message-formatting/src/AppUnknownExport.js index 482a545240..2864d46944 100644 --- a/test/fixtures/webpack-message-formatting/src/AppUnknownExport.js +++ b/test/fixtures/webpack-message-formatting/src/AppUnknownExport.js @@ -1,4 +1,4 @@ -import React, { Component } from 'react'; +import { Component } from 'react'; import { bar } from './AppUnknownExport'; class App extends Component { diff --git a/test/fixtures/webpack-message-formatting/src/AppUnknownFile.js b/test/fixtures/webpack-message-formatting/src/AppUnknownFile.js index d3b2ce2673..0a477af145 100644 --- a/test/fixtures/webpack-message-formatting/src/AppUnknownFile.js +++ b/test/fixtures/webpack-message-formatting/src/AppUnknownFile.js @@ -1,4 +1,4 @@ -import React, { Component } from 'react'; +import { Component } from 'react'; import DefaultExport from './ThisFileSouldNotExist'; class App extends Component { diff --git a/test/fixtures/webpack-message-formatting/src/index.js b/test/fixtures/webpack-message-formatting/src/index.js index b597a44232..606d7ac488 100644 --- a/test/fixtures/webpack-message-formatting/src/index.js +++ b/test/fixtures/webpack-message-formatting/src/index.js @@ -1,4 +1,3 @@ -import React from 'react'; import ReactDOM from 'react-dom'; import App from './App'; From fc78bd3b40f530c04337c475180d4dee29346db8 Mon Sep 17 00:00:00 2001 From: Nick McCurdy Date: Sun, 25 Oct 2020 12:26:40 -0400 Subject: [PATCH 2/6] fix: add missing React imports (not for JSX) --- .../kitchensink/template/src/features/webpack/SvgComponent.js | 2 +- .../template/src/features/webpack/SvgComponent.test.js | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/react-scripts/fixtures/kitchensink/template/src/features/webpack/SvgComponent.js b/packages/react-scripts/fixtures/kitchensink/template/src/features/webpack/SvgComponent.js index 0fda787703..71e21dfa37 100644 --- a/packages/react-scripts/fixtures/kitchensink/template/src/features/webpack/SvgComponent.js +++ b/packages/react-scripts/fixtures/kitchensink/template/src/features/webpack/SvgComponent.js @@ -5,7 +5,7 @@ * LICENSE file in the root directory of this source tree. */ -import { ReactComponent as Logo } from './assets/logo.svg'; +import React, { ReactComponent as Logo } from './assets/logo.svg'; const SvgComponent = () => { return ; diff --git a/packages/react-scripts/fixtures/kitchensink/template/src/features/webpack/SvgComponent.test.js b/packages/react-scripts/fixtures/kitchensink/template/src/features/webpack/SvgComponent.test.js index b8904f909b..493a6bc87b 100644 --- a/packages/react-scripts/fixtures/kitchensink/template/src/features/webpack/SvgComponent.test.js +++ b/packages/react-scripts/fixtures/kitchensink/template/src/features/webpack/SvgComponent.test.js @@ -5,6 +5,7 @@ * LICENSE file in the root directory of this source tree. */ +import React from 'react'; import ReactDOM from 'react-dom'; import SvgComponent, { SvgComponentWithRef } from './SvgComponent'; From 1ec7aa20e3e326dd8b0b1d0953d591498005bb24 Mon Sep 17 00:00:00 2001 From: Nick McCurdy Date: Tue, 27 Oct 2020 12:44:33 -0400 Subject: [PATCH 3/6] fix: add missing React imports for StrictMode --- packages/cra-template-typescript/template/src/index.tsx | 1 + packages/cra-template/template/src/index.js | 1 + 2 files changed, 2 insertions(+) diff --git a/packages/cra-template-typescript/template/src/index.tsx b/packages/cra-template-typescript/template/src/index.tsx index fda99ee1f6..ef2edf8ea3 100644 --- a/packages/cra-template-typescript/template/src/index.tsx +++ b/packages/cra-template-typescript/template/src/index.tsx @@ -1,3 +1,4 @@ +import React from 'react'; import ReactDOM from 'react-dom'; import './index.css'; import App from './App'; diff --git a/packages/cra-template/template/src/index.js b/packages/cra-template/template/src/index.js index fda99ee1f6..ef2edf8ea3 100644 --- a/packages/cra-template/template/src/index.js +++ b/packages/cra-template/template/src/index.js @@ -1,3 +1,4 @@ +import React from 'react'; import ReactDOM from 'react-dom'; import './index.css'; import App from './App'; From 63171a8c4a52cb05dc4ce629f65fb6efea291cb4 Mon Sep 17 00:00:00 2001 From: Nick McCurdy Date: Wed, 8 Jun 2022 10:17:29 -0400 Subject: [PATCH 4/6] fix: missing import --- test/fixtures/mjs-support/src/App.js | 1 + 1 file changed, 1 insertion(+) diff --git a/test/fixtures/mjs-support/src/App.js b/test/fixtures/mjs-support/src/App.js index 123eed0858..e52267203d 100644 --- a/test/fixtures/mjs-support/src/App.js +++ b/test/fixtures/mjs-support/src/App.js @@ -1,3 +1,4 @@ +import { Component } from 'react'; import { graphql, GraphQLSchema, From 1ba6803ab826705ab99bc6e7314244335a547c72 Mon Sep 17 00:00:00 2001 From: Nick McCurdy Date: Wed, 8 Jun 2022 10:22:59 -0400 Subject: [PATCH 5/6] fix: reintroduce lint fix --- .../template/src/features/syntax/AsyncAwait.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/packages/react-scripts/fixtures/kitchensink/template/src/features/syntax/AsyncAwait.js b/packages/react-scripts/fixtures/kitchensink/template/src/features/syntax/AsyncAwait.js index c588b173f7..afeace8a43 100644 --- a/packages/react-scripts/fixtures/kitchensink/template/src/features/syntax/AsyncAwait.js +++ b/packages/react-scripts/fixtures/kitchensink/template/src/features/syntax/AsyncAwait.js @@ -10,9 +10,16 @@ async function load() { ]; } -const x = async (y: void) => { +/* eslint-disable */ +// Regression test for https://github.com/facebook/create-react-app/issues/3055 +const x = async ( + /* prettier-ignore */ + y: void +) => { const z = await y; }; +/* eslint-enable */ + export default class AsyncAwait extends Component { static propTypes = { onReady: PropTypes.func.isRequired, From fa0afb3a47b2b320a9d2e80cb7a39a926cf0f69b Mon Sep 17 00:00:00 2001 From: Nick McCurdy Date: Wed, 8 Jun 2022 14:55:08 +0000 Subject: [PATCH 6/6] fix: use named imports --- packages/cra-template-typescript/template/src/index.tsx | 6 +++--- packages/cra-template/template/src/index.js | 6 +++--- .../template/src/features/webpack/SvgComponent.js | 4 ++-- .../template/src/features/webpack/SvgComponent.test.js | 4 ++-- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/packages/cra-template-typescript/template/src/index.tsx b/packages/cra-template-typescript/template/src/index.tsx index 032464fb6e..a61cb0c0d5 100644 --- a/packages/cra-template-typescript/template/src/index.tsx +++ b/packages/cra-template-typescript/template/src/index.tsx @@ -1,4 +1,4 @@ -import React from 'react'; +import { StrictMode } from 'react'; import ReactDOM from 'react-dom/client'; import './index.css'; import App from './App'; @@ -8,9 +8,9 @@ const root = ReactDOM.createRoot( document.getElementById('root') as HTMLElement ); root.render( - + - + ); // If you want to start measuring performance in your app, pass a function diff --git a/packages/cra-template/template/src/index.js b/packages/cra-template/template/src/index.js index d563c0fb10..5525e4fdb9 100644 --- a/packages/cra-template/template/src/index.js +++ b/packages/cra-template/template/src/index.js @@ -1,4 +1,4 @@ -import React from 'react'; +import { StrictMode } from 'react'; import ReactDOM from 'react-dom/client'; import './index.css'; import App from './App'; @@ -6,9 +6,9 @@ import reportWebVitals from './reportWebVitals'; const root = ReactDOM.createRoot(document.getElementById('root')); root.render( - + - + ); // If you want to start measuring performance in your app, pass a function diff --git a/packages/react-scripts/fixtures/kitchensink/template/src/features/webpack/SvgComponent.js b/packages/react-scripts/fixtures/kitchensink/template/src/features/webpack/SvgComponent.js index 71e21dfa37..dd0d2da71a 100644 --- a/packages/react-scripts/fixtures/kitchensink/template/src/features/webpack/SvgComponent.js +++ b/packages/react-scripts/fixtures/kitchensink/template/src/features/webpack/SvgComponent.js @@ -5,13 +5,13 @@ * LICENSE file in the root directory of this source tree. */ -import React, { ReactComponent as Logo } from './assets/logo.svg'; +import { forwardRef, ReactComponent as Logo } from './assets/logo.svg'; const SvgComponent = () => { return ; }; -export const SvgComponentWithRef = React.forwardRef((props, ref) => ( +export const SvgComponentWithRef = forwardRef((props, ref) => ( )); diff --git a/packages/react-scripts/fixtures/kitchensink/template/src/features/webpack/SvgComponent.test.js b/packages/react-scripts/fixtures/kitchensink/template/src/features/webpack/SvgComponent.test.js index 493a6bc87b..041ac4e288 100644 --- a/packages/react-scripts/fixtures/kitchensink/template/src/features/webpack/SvgComponent.test.js +++ b/packages/react-scripts/fixtures/kitchensink/template/src/features/webpack/SvgComponent.test.js @@ -5,7 +5,7 @@ * LICENSE file in the root directory of this source tree. */ -import React from 'react'; +import { createRef } from 'react'; import ReactDOM from 'react-dom'; import SvgComponent, { SvgComponentWithRef } from './SvgComponent'; @@ -18,7 +18,7 @@ describe('svg component', () => { it('svg root element equals the passed ref', () => { const div = document.createElement('div'); - const someRef = React.createRef(); + const someRef = createRef(); ReactDOM.render(, div); const svgElement = div.getElementsByTagName('svg'); expect(svgElement).toHaveLength(1);