[SG-33302] Upgrade all client packages to use the latest version of the JSX transform (#34287)

Co-authored-by: gitstart-sourcegraph <gitstart@users.noreply.github.com>
This commit is contained in:
GitStart-SourceGraph 2022-04-22 16:55:38 +05:30 committed by GitHub
parent ba62261f2c
commit 44082f5b73
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
466 changed files with 123 additions and 827 deletions

View File

@ -140,6 +140,9 @@ See https://handbook.sourcegraph.com/community/faq#is-all-of-sourcegraph-open-so
'Consider using useTemporarySetting instead of useLocalStorage so settings are synced when users log in elsewhere. More info at https://docs.sourcegraph.com/dev/background-information/web/temporary_settings',
},
],
// https://reactjs.org/blog/2020/09/22/introducing-the-new-jsx-transform.html#eslint
'react/jsx-uses-react': 'off',
'react/react-in-jsx-scope': 'off',
},
overrides: [
{

View File

@ -48,7 +48,12 @@ module.exports = api => {
},
],
'@babel/preset-typescript',
'@babel/preset-react',
[
'@babel/preset-react',
{
runtime: 'automatic',
},
],
],
plugins: [['@babel/plugin-transform-typescript', { isTSX: true }], 'babel-plugin-lodash'],
// Required for d3-array v1.2 (dependency of recharts). See https://github.com/babel/babel/issues/11038

View File

@ -1,5 +1,3 @@
import React from 'react'
import { boolean } from '@storybook/addon-knobs'
import { DecoratorFn, Meta, Story } from '@storybook/react'

View File

@ -1,5 +1,3 @@
import React from 'react'
import { render } from '@testing-library/react'
import { LoaderInput } from './LoaderInput'

View File

@ -1,4 +1,4 @@
import React, { useState } from 'react'
import { useState } from 'react'
import { action } from '@storybook/addon-actions'
import { DecoratorFn, Meta, Story } from '@storybook/react'

View File

@ -1,5 +1,3 @@
import React from 'react'
import { render, screen } from '@testing-library/react'
import userEvent from '@testing-library/user-event'
import sinon from 'sinon'

View File

@ -1,4 +1,4 @@
import React, { useState } from 'react'
import { useState } from 'react'
import { action } from '@storybook/addon-actions'
import { DecoratorFn, Meta, Story } from '@storybook/react'

View File

@ -1,5 +1,3 @@
import React from 'react'
import { render, screen } from '@testing-library/react'
import userEvent from '@testing-library/user-event'
import sinon from 'sinon'

View File

@ -1,5 +1,3 @@
import React from 'react'
import { render } from '@testing-library/react'
import { ErrorAlert } from './alerts'

View File

@ -1,5 +1,3 @@
import React from 'react'
import { DecoratorFn, Meta, Story } from '@storybook/react'
import { noop } from 'lodash'
import { EMPTY, of } from 'rxjs'

View File

@ -1,5 +1,3 @@
import React from 'react'
import { cleanup, fireEvent } from '@testing-library/react'
import { renderWithBrandedContext } from '@sourcegraph/shared/src/testing'

View File

@ -1,5 +1,3 @@
import React from 'react'
import { DecoratorFn, Meta, Story } from '@storybook/react'
import * as H from 'history'
import { of } from 'rxjs'

View File

@ -1,5 +1,3 @@
import React from 'react'
import { render } from '@testing-library/react'
import * as H from 'history'
import { noop } from 'lodash'

View File

@ -2,7 +2,7 @@
// documentation of all the Bootstrap classes we have available in our app, please see refer to the Bootstrap
// documentation for that. Its primary purpose is to show what Bootstrap's componenents look like with our styling
// customizations.
import React, { useState } from 'react'
import { useState } from 'react'
import { action } from '@storybook/addon-actions'
import { number } from '@storybook/addon-knobs'

View File

@ -1,7 +1,7 @@
{
"extends": "../../tsconfig.json",
"compilerOptions": {
"jsx": "react",
"jsx": "react-jsx",
"module": "esnext",
"sourceRoot": "src",
"baseUrl": ".",

View File

@ -1,4 +1,4 @@
import React, { useEffect, useMemo, useState } from 'react'
import { useEffect, useMemo, useState } from 'react'
import { ThemeProps } from '@sourcegraph/shared/src/theme'

View File

@ -1,5 +1,3 @@
import React from 'react'
import { Meta, Story } from '@storybook/react'
import { BrandedStory } from '@sourcegraph/branded/src/components/BrandedStory'

View File

@ -1,5 +1,3 @@
import React from 'react'
import classNames from 'classnames'
import { trimStart } from 'lodash'
import { render } from 'react-dom'

View File

@ -1,5 +1,3 @@
import * as React from 'react'
import { render } from '@testing-library/react'
import { noop } from 'lodash'

View File

@ -1,5 +1,3 @@
import * as React from 'react'
import classNames from 'classnames'
import * as H from 'history'
import { isEqual } from 'lodash'

View File

@ -15,7 +15,7 @@
"paths": {
"*": ["src/types/*", "../shared/src/types/*", "../common/src/types/*", "*"],
},
"jsx": "react",
"jsx": "react-jsx",
"resolveJsonModule": true,
"rootDir": ".",
"outDir": "out",

View File

@ -2,7 +2,7 @@
"extends": "../../tsconfig.json",
"references": [{ "path": "../common" }],
"compilerOptions": {
"jsx": "react",
"jsx": "react-jsx",
"module": "commonjs",
"sourceRoot": "src",
"rootDir": ".",

View File

@ -1,5 +1,3 @@
import React from 'react'
import { storiesOf } from '@storybook/react'
import { BrandedStory } from '@sourcegraph/branded/src/components/BrandedStory'

View File

@ -1,5 +1,3 @@
import React from 'react'
import { render } from '@testing-library/react'
import { SyntaxHighlightedSearchQuery } from './SyntaxHighlightedSearchQuery'

View File

@ -1,5 +1,3 @@
import React from 'react'
import { render } from '@testing-library/react'
import { noop } from 'lodash'

View File

@ -1,5 +1,3 @@
import React from 'react'
import { storiesOf } from '@storybook/react'
import { BrandedStory } from '@sourcegraph/branded/src/components/BrandedStory'

View File

@ -1,5 +1,3 @@
import React from 'react'
import { storiesOf } from '@storybook/react'
import { BrandedStory } from '@sourcegraph/branded/src/components/BrandedStory'

View File

@ -1,5 +1,3 @@
import React from 'react'
import { storiesOf } from '@storybook/react'
import { BrandedStory } from '@sourcegraph/branded/src/components/BrandedStory'

View File

@ -1,5 +1,3 @@
import React from 'react'
import { render, screen, waitFor } from '@testing-library/react'
import userEvent from '@testing-library/user-event'
import { act } from 'react-dom/test-utils'

View File

@ -1,5 +1,3 @@
import React from 'react'
import { storiesOf } from '@storybook/react'
import { Observable, of } from 'rxjs'

View File

@ -1,5 +1,3 @@
import React from 'react'
import { render, screen } from '@testing-library/react'
import userEvent from '@testing-library/user-event'
import { act } from 'react-dom/test-utils'

View File

@ -1,5 +1,3 @@
import React from 'react'
import { storiesOf } from '@storybook/react'
import { noop } from 'lodash'

View File

@ -1,5 +1,3 @@
import React from 'react'
import { screen } from '@testing-library/react'
import { SearchPatternType } from '@sourcegraph/shared/src/schema'

View File

@ -1,5 +1,3 @@
import * as React from 'react'
import { storiesOf } from '@storybook/react'
import sinon from 'sinon'

View File

@ -1,5 +1,3 @@
import React from 'react'
import { render } from '@testing-library/react'
import { Progress } from '@sourcegraph/shared/src/search/stream'

View File

@ -1,5 +1,3 @@
import React from 'react'
import { screen, waitFor } from '@testing-library/react'
import userEvent from '@testing-library/user-event'
import sinon from 'sinon'

View File

@ -1,5 +1,3 @@
import * as React from 'react'
import { storiesOf } from '@storybook/react'
import { BrandedStory } from '@sourcegraph/branded/src/components/BrandedStory'

View File

@ -1,5 +1,3 @@
import React from 'react'
import { screen, within } from '@testing-library/react'
import userEvent from '@testing-library/user-event'
import sinon from 'sinon'

View File

@ -1,5 +1,3 @@
import React from 'react'
import { screen } from '@testing-library/react'
import userEvent from '@testing-library/user-event'
import sinon from 'sinon'

View File

@ -1,5 +1,3 @@
import React from 'react'
import { QuickLink } from '@sourcegraph/shared/src/schema/settings.schema'
import { renderWithBrandedContext } from '@sourcegraph/shared/src/testing'

View File

@ -1,5 +1,3 @@
import React from 'react'
import { storiesOf } from '@storybook/react'
// We need to import `create` to make a mock store just for this story.
// eslint-disable-next-line no-restricted-imports

View File

@ -1,5 +1,3 @@
import React from 'react'
import { render, screen } from '@testing-library/react'
import userEvent from '@testing-library/user-event'
import sinon from 'sinon'

View File

@ -6,7 +6,7 @@
"rootDir": ".",
"outDir": "./out",
"baseUrl": "./src",
"jsx": "react",
"jsx": "react-jsx",
},
"include": ["./src/**/*", "./*.ts"],
"exclude": ["../../node_modules", "./node_modules", "./out"],

View File

@ -6,7 +6,7 @@
"rootDir": ".",
"outDir": "./out",
"baseUrl": "./src",
"jsx": "react",
"jsx": "react-jsx",
},
"include": ["./src/**/*", "./*.ts"],
"exclude": ["../../node_modules", "./node_modules", "./out"],

View File

@ -1,5 +1,3 @@
import React from 'react'
import { action } from '@storybook/addon-actions'
import { DecoratorFn, Meta, Story } from '@storybook/react'
import * as H from 'history'

View File

@ -1,5 +1,3 @@
import React from 'react'
import { render, screen, waitFor } from '@testing-library/react'
import userEvent from '@testing-library/user-event'
import * as H from 'history'

View File

@ -1,5 +1,3 @@
import React from 'react'
import { render, act, RenderResult } from '@testing-library/react'
import * as H from 'history'
import { of, NEVER } from 'rxjs'

View File

@ -1,5 +1,3 @@
import React from 'react'
import { DecoratorFn, Meta, Story } from '@storybook/react'
// eslint-disable-next-line no-restricted-imports

View File

@ -1,5 +1,3 @@
import * as React from 'react'
import { cleanup, getAllByTestId, getByTestId } from '@testing-library/react'
import { createBrowserHistory } from 'history'
import FileIcon from 'mdi-react/FileIcon'

View File

@ -1,5 +1,3 @@
import * as React from 'react'
import { cleanup } from '@testing-library/react'
import * as H from 'history'
import _VisibilitySensor from 'react-visibility-sensor'

View File

@ -1,5 +1,3 @@
import React from 'react'
import { render } from '@testing-library/react'
import { fuzzyMatches, HighlightedMatches, Span } from './HighlightedMatches'

View File

@ -1,5 +1,3 @@
import React from 'react'
import { render } from '@testing-library/react'
import { LinkOrSpan } from './LinkOrSpan'

View File

@ -1,5 +1,3 @@
import React from 'react'
import { render } from '@testing-library/react'
import { Markdown } from './Markdown'

View File

@ -1,5 +1,3 @@
import React from 'react'
import { render } from '@testing-library/react'
import { Path } from './Path'

View File

@ -1,5 +1,3 @@
import React from 'react'
import { renderWithBrandedContext } from '../testing'
import { RepoFileLink } from './RepoFileLink'

View File

@ -1,5 +1,3 @@
import React from 'react'
import { render } from '@testing-library/react'
import { RepoLink } from './RepoLink'

View File

@ -1,5 +1,3 @@
import * as React from 'react'
import { cleanup, fireEvent, getByTestId, getByText } from '@testing-library/react'
import * as H from 'history'
import FileIcon from 'mdi-react/FileIcon'

View File

@ -1,5 +1,3 @@
import React from 'react'
import { renderWithBrandedContext } from '../../testing'
import { ActivationChecklist } from './ActivationChecklist'

View File

@ -1,7 +1,5 @@
import assert from 'assert'
import React from 'react'
import { createMemoryHistory } from 'history'
import ReactDOM from 'react-dom'
import * as sinon from 'sinon'

View File

@ -1,5 +1,3 @@
import React from 'react'
import bitbucketStyles from '@atlassian/aui/dist/aui/css/aui.css'
import { DecoratorFn, Meta, Story } from '@storybook/react'
import classNames from 'classnames'

View File

@ -1,5 +1,3 @@
import React from 'react'
import { render } from '@testing-library/react'
import * as H from 'history'
import { NEVER } from 'rxjs'

View File

@ -1,5 +1,3 @@
import React from 'react'
import { ShortcutProvider } from '@slimsag/react-shortcuts'
import { fireEvent, waitFor, screen } from '@testing-library/react'

View File

@ -1,5 +1,3 @@
import React from 'react'
import { action } from '@storybook/addon-actions'
import { number, select, text } from '@storybook/addon-knobs'
import { DecoratorFn, Meta, Story } from '@storybook/react'

View File

@ -1,4 +1,4 @@
import React, { useEffect } from 'react'
import { useEffect } from 'react'
import { gql } from '@apollo/client'
import { createMockClient } from '@apollo/client/testing'

View File

@ -1,4 +1,4 @@
import React, { ReactNode } from 'react'
import { ReactNode } from 'react'
import { RenderResult, render } from '@testing-library/react'
import { MemoryHistory, createMemoryHistory } from 'history'

View File

@ -1,7 +1,7 @@
{
"extends": "../../tsconfig.json",
"compilerOptions": {
"jsx": "react",
"jsx": "react-jsx",
"module": "esnext",
"sourceRoot": "src",
"baseUrl": ".",

View File

@ -6,7 +6,7 @@
"rootDir": ".",
"outDir": "./out",
"baseUrl": "./src",
"jsx": "react",
"jsx": "react-jsx",
},
"references": [{ "path": "../shared" }, { "path": "../build-config" }, { "path": "../http-client" }],
"include": ["./src/**/*", "./*.ts"],

View File

@ -13,7 +13,7 @@
"esModuleInterop": true,
"resolveJsonModule": true,
"strict": true,
"jsx": "react",
"jsx": "react-jsx",
},
"references": [
{ "path": "../shared" },

View File

@ -1,5 +1,3 @@
import React from 'react'
import { cleanup, render } from '@testing-library/react'
import { MemoryRouter } from 'react-router-dom'

View File

@ -1,5 +1,3 @@
import React from 'react'
import { render } from '@testing-library/react'
import { createBrowserHistory } from 'history'
import { BrowserRouter } from 'react-router-dom'

View File

@ -1,5 +1,3 @@
import React from 'react'
import { storiesOf } from '@storybook/react'
import sinon from 'sinon'

View File

@ -1,5 +1,3 @@
import React from 'react'
import { storiesOf } from '@storybook/react'
import { Card } from '@sourcegraph/wildcard'

View File

@ -1,5 +1,3 @@
import React from 'react'
import { createMemoryHistory, createLocation } from 'history'
import { MemoryRouter } from 'react-router'

View File

@ -1,5 +1,3 @@
import React from 'react'
import { createMemoryHistory, createLocation } from 'history'
import { MemoryRouter } from 'react-router'

View File

@ -1,5 +1,3 @@
import React from 'react'
import { Meta, Story } from '@storybook/react'
import { BrandedStory } from '@sourcegraph/branded/src/components/BrandedStory'

View File

@ -1,5 +1,3 @@
import React from 'react'
import { render, RenderResult, cleanup } from '@testing-library/react'
import sinon from 'sinon'

View File

@ -1,5 +1,3 @@
import React from 'react'
import { storiesOf } from '@storybook/react'
import { WebStory } from '../components/WebStory'

View File

@ -1,5 +1,3 @@
import React from 'react'
import { MockedProvider } from '@apollo/client/testing'
import { fireEvent, render } from '@testing-library/react'
import * as sinon from 'sinon'

View File

@ -1,5 +1,3 @@
import React from 'react'
import { number } from '@storybook/addon-knobs'
import { storiesOf } from '@storybook/react'
import { of } from 'rxjs'

View File

@ -1,4 +1,4 @@
import React, { FC, useMemo } from 'react'
import { FC, useMemo } from 'react'
import { encodeURIPathComponent } from '@sourcegraph/common'
import { Badge, useObservable, Button, Link, Icon } from '@sourcegraph/wildcard'

View File

@ -1,4 +1,4 @@
import React, { useState } from 'react'
import { useState } from 'react'
import { Meta, Story } from '@storybook/react'
import { ParentSize } from '@visx/responsive'

View File

@ -1,4 +1,4 @@
import React, { ReactElement, useMemo, useState, SVGProps } from 'react'
import { ReactElement, useMemo, useState, SVGProps } from 'react'
import { curveLinear } from '@visx/curve'
import { Group } from '@visx/group'

View File

@ -1,4 +1,4 @@
import React, { forwardRef, memo } from 'react'
import { forwardRef, memo } from 'react'
import { AxisLeft as VisxAxisLeft, AxisBottom as VisxAsixBottom } from '@visx/axis'
import { AxisScale } from '@visx/axis/lib/types'

View File

@ -1,5 +1,3 @@
import React from 'react'
import { Meta, Story } from '@storybook/react'
import { WebStory } from '../../../../../components/WebStory'

View File

@ -1,4 +1,4 @@
import React, { ReactElement, useMemo } from 'react'
import { ReactElement, useMemo } from 'react'
import { isDefined } from '@sourcegraph/common'

View File

@ -1,5 +1,3 @@
import React from 'react'
import { Meta, Story } from '@storybook/react'
import { WebStory } from '../../../components/WebStory'

View File

@ -1,4 +1,4 @@
import React, { ReactElement, SVGProps, useMemo, useState } from 'react'
import { ReactElement, SVGProps, useMemo, useState } from 'react'
import { Group } from '@visx/group'
import Pie, { PieArcDatum } from '@visx/shape/lib/shapes/Pie'

View File

@ -1,4 +1,4 @@
import React, { PointerEventHandler, ReactElement } from 'react'
import { PointerEventHandler, ReactElement } from 'react'
import { Annotation, HtmlLabel, Connector } from '@visx/annotation'
import { Group } from '@visx/group'

View File

@ -1,5 +1,3 @@
import React from 'react'
import { storiesOf } from '@storybook/react'
import { WebStory } from '../components/WebStory'

View File

@ -1,5 +1,3 @@
import React from 'react'
import { action } from '@storybook/addon-actions'
import { storiesOf } from '@storybook/react'
import { subDays } from 'date-fns'

View File

@ -1,5 +1,3 @@
import * as React from 'react'
import { lazyComponent } from '@sourcegraph/shared/src/util/lazyComponent'
import { LayoutRouteProps } from '../routes'

View File

@ -1,5 +1,3 @@
import React from 'react'
import { action } from '@storybook/addon-actions'
import { boolean } from '@storybook/addon-knobs'
import { DecoratorFn, Meta, Story } from '@storybook/react'

View File

@ -1,5 +1,3 @@
import React from 'react'
import { render } from '@testing-library/react'
import * as H from 'history'
import sinon from 'sinon'

View File

@ -1,5 +1,3 @@
import React from 'react'
import { storiesOf } from '@storybook/react'
import { Link } from '@sourcegraph/wildcard'

View File

@ -1,5 +1,3 @@
import React from 'react'
import { storiesOf } from '@storybook/react'
import { Link } from '@sourcegraph/wildcard'

View File

@ -1,5 +1,3 @@
import React from 'react'
import { cleanup, fireEvent, render, screen, waitFor } from '@testing-library/react'
import { createLocation } from 'history'
import sinon from 'sinon'

View File

@ -1,5 +1,3 @@
import React from 'react'
import { MockedResponse } from '@apollo/client/testing'
import { fireEvent } from '@testing-library/react'

View File

@ -1,5 +1,3 @@
import * as React from 'react'
import classNames from 'classnames'
import { pluralize } from '@sourcegraph/common'

View File

@ -1,5 +1,3 @@
import React from 'react'
import { storiesOf } from '@storybook/react'
import { LoaderButton } from './LoaderButton'

View File

@ -1,5 +1,3 @@
import React from 'react'
import { renderWithBrandedContext } from '@sourcegraph/shared/src/testing'
import { LoaderButton } from './LoaderButton'

Some files were not shown because too many files have changed in this diff Show More