Skip to content

Commit dd55d45

Browse files
authored
chore: remove react imports (#1867)
reolves #1856
1 parent 26a2a16 commit dd55d45

File tree

177 files changed

+192
-293
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

177 files changed

+192
-293
lines changed

site/.eslintrc.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,9 @@ rules:
114114
react/jsx-curly-brace-presence:
115115
- error
116116
- children: ignore
117+
# https://reactjs.org/blog/2020/09/22/introducing-the-new-jsx-transform.html#eslint
118+
react/jsx-uses-react: "off"
119+
react/react-in-jsx-scope: "off"
117120
settings:
118121
react:
119122
version: detect

site/src/AppRouter.tsx

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import React from "react"
1+
import { FC, lazy, Suspense } from "react"
22
import { Route, Routes } from "react-router-dom"
33
import { AuthAndFrame } from "./components/AuthAndFrame/AuthAndFrame"
44
import { RequireAuth } from "./components/RequireAuth/RequireAuth"
@@ -19,12 +19,12 @@ import { WorkspaceBuildPage } from "./pages/WorkspaceBuildPage/WorkspaceBuildPag
1919
import { WorkspacePage } from "./pages/WorkspacePage/WorkspacePage"
2020
import { WorkspaceSchedulePage } from "./pages/WorkspaceSchedulePage/WorkspaceSchedulePage"
2121

22-
const TerminalPage = React.lazy(() => import("./pages/TerminalPage/TerminalPage"))
23-
const WorkspacesPage = React.lazy(() => import("./pages/WorkspacesPage/WorkspacesPage"))
24-
const CreateWorkspacePage = React.lazy(() => import("./pages/CreateWorkspacePage/CreateWorkspacePage"))
22+
const TerminalPage = lazy(() => import("./pages/TerminalPage/TerminalPage"))
23+
const WorkspacesPage = lazy(() => import("./pages/WorkspacesPage/WorkspacesPage"))
24+
const CreateWorkspacePage = lazy(() => import("./pages/CreateWorkspacePage/CreateWorkspacePage"))
2525

26-
export const AppRouter: React.FC = () => (
27-
<React.Suspense fallback={<></>}>
26+
export const AppRouter: FC = () => (
27+
<Suspense fallback={<></>}>
2828
<Routes>
2929
<Route path="/">
3030
<Route
@@ -159,5 +159,5 @@ export const AppRouter: React.FC = () => (
159159
<Route path="*" element={<NotFoundPage />} />
160160
</Route>
161161
</Routes>
162-
</React.Suspense>
162+
</Suspense>
163163
)

site/src/Main.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import { inspect } from "@xstate/inspect"
2-
import React from "react"
32
import ReactDOM from "react-dom"
43
import { Interpreter } from "xstate"
54
import { App } from "./app"

site/src/__mocks__/react-markdown.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import React from "react"
1+
import { FC } from "react"
22

3-
const ReactMarkdown: React.FC = ({ children }) => {
3+
const ReactMarkdown: FC = ({ children }) => {
44
return <div data-testid="markdown">{children}</div>
55
}
66

site/src/app.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import CssBaseline from "@material-ui/core/CssBaseline"
22
import ThemeProvider from "@material-ui/styles/ThemeProvider"
3-
import React from "react"
3+
import { FC } from "react"
44
import { BrowserRouter as Router } from "react-router-dom"
55
import { SWRConfig } from "swr"
66
import { AppRouter } from "./AppRouter"
@@ -10,7 +10,7 @@ import { dark } from "./theme"
1010
import "./theme/globalFonts"
1111
import { XServiceProvider } from "./xServices/StateContext"
1212

13-
export const App: React.FC = () => {
13+
export const App: FC = () => {
1414
return (
1515
<Router>
1616
<SWRConfig

site/src/components/AuthAndFrame/AuthAndFrame.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import React from "react"
1+
import { FC } from "react"
22
import { Footer } from "../Footer/Footer"
33
import { Navbar } from "../Navbar/Navbar"
44
import { RequireAuth } from "../RequireAuth/RequireAuth"
@@ -10,7 +10,7 @@ interface AuthAndFrameProps {
1010
/**
1111
* Wraps page in RequireAuth and renders it between Navbar and Footer
1212
*/
13-
export const AuthAndFrame: React.FC<AuthAndFrameProps> = ({ children }) => (
13+
export const AuthAndFrame: FC<AuthAndFrameProps> = ({ children }) => (
1414
<RequireAuth>
1515
<>
1616
<Navbar />

site/src/components/AvatarData/AvatarData.stories.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import { Story } from "@storybook/react"
2-
import React from "react"
32
import { AvatarData, AvatarDataProps } from "./AvatarData"
43

54
export default {

site/src/components/AvatarData/AvatarData.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import Avatar from "@material-ui/core/Avatar"
22
import Link from "@material-ui/core/Link"
33
import { makeStyles } from "@material-ui/core/styles"
4-
import React from "react"
4+
import { FC } from "react"
55
import { Link as RouterLink } from "react-router-dom"
66
import { combineClasses } from "../../util/combineClasses"
77
import { firstLetter } from "../../util/firstLetter"
@@ -12,7 +12,7 @@ export interface AvatarDataProps {
1212
link?: string
1313
}
1414

15-
export const AvatarData: React.FC<AvatarDataProps> = ({ title, subtitle, link }) => {
15+
export const AvatarData: FC<AvatarDataProps> = ({ title, subtitle, link }) => {
1616
const styles = useStyles()
1717

1818
return (

site/src/components/BorderedMenu/BorderedMenu.stories.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import { Story } from "@storybook/react"
2-
import React from "react"
32
import { BorderedMenuRow } from "../BorderedMenuRow/BorderedMenuRow"
43
import { BuildingIcon } from "../Icons/BuildingIcon"
54
import { UsersOutlinedIcon } from "../Icons/UsersOutlinedIcon"

site/src/components/BorderedMenu/BorderedMenu.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
import Popover, { PopoverProps } from "@material-ui/core/Popover"
22
import { fade, makeStyles } from "@material-ui/core/styles"
3-
import React from "react"
3+
import { FC } from "react"
44

55
type BorderedMenuVariant = "admin-dropdown" | "user-dropdown"
66

77
export type BorderedMenuProps = Omit<PopoverProps, "variant"> & {
88
variant?: BorderedMenuVariant
99
}
1010

11-
export const BorderedMenu: React.FC<BorderedMenuProps> = ({ children, variant, ...rest }) => {
11+
export const BorderedMenu: FC<BorderedMenuProps> = ({ children, variant, ...rest }) => {
1212
const styles = useStyles()
1313

1414
return (

0 commit comments

Comments
 (0)