Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

chore: remove react imports#1867

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
Kira-Pilot merged 3 commits intomainfromno-more-react-imports/kira-pilot
May 31, 2022
Merged
Show file tree
Hide file tree
Changes from1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletionssite/.eslintrc.yaml
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -114,6 +114,9 @@ rules:
react/jsx-curly-brace-presence:
- error
- children: ignore
# 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"
Copy link
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Turning off these ESLint rules (as suggested by React) so we don't hear it complain.

settings:
react:
version: detect
Expand Down
14 changes: 7 additions & 7 deletionssite/src/AppRouter.tsx
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
importReact from "react"
import{ FC, lazy, Suspense } from "react"
import { Route, Routes } from "react-router-dom"
import { AuthAndFrame } from "./components/AuthAndFrame/AuthAndFrame"
import { RequireAuth } from "./components/RequireAuth/RequireAuth"
Expand All@@ -18,12 +18,12 @@ import { WorkspaceBuildPage } from "./pages/WorkspaceBuildPage/WorkspaceBuildPag
import { WorkspacePage } from "./pages/WorkspacePage/WorkspacePage"
import { WorkspaceSchedulePage } from "./pages/WorkspaceSchedulePage/WorkspaceSchedulePage"

const TerminalPage =React.lazy(() => import("./pages/TerminalPage/TerminalPage"))
const WorkspacesPage =React.lazy(() => import("./pages/WorkspacesPage/WorkspacesPage"))
const CreateWorkspacePage =React.lazy(() => import("./pages/CreateWorkspacePage/CreateWorkspacePage"))
const TerminalPage = lazy(() => import("./pages/TerminalPage/TerminalPage"))
const WorkspacesPage = lazy(() => import("./pages/WorkspacesPage/WorkspacesPage"))
const CreateWorkspacePage = lazy(() => import("./pages/CreateWorkspacePage/CreateWorkspacePage"))

export const AppRouter:React.FC = () => (
<React.Suspense fallback={<></>}>
export const AppRouter: FC = () => (
<Suspense fallback={<></>}>
<Routes>
<Route path="/">
<Route
Expand DownExpand Up@@ -157,5 +157,5 @@ export const AppRouter: React.FC = () => (
<Route path="*" element={<NotFoundPage />} />
</Route>
</Routes>
</React.Suspense>
</Suspense>
)
1 change: 0 additions & 1 deletionsite/src/Main.tsx
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
import { inspect } from "@xstate/inspect"
import React from "react"
import ReactDOM from "react-dom"
import { Interpreter } from "xstate"
import { App } from "./app"
Expand Down
4 changes: 2 additions & 2 deletionssite/src/__mocks__/react-markdown.tsx
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
importReact from "react"
import{ FC } from "react"

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

Expand Down
4 changes: 2 additions & 2 deletionssite/src/app.tsx
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
import CssBaseline from "@material-ui/core/CssBaseline"
import ThemeProvider from "@material-ui/styles/ThemeProvider"
importReact from "react"
import{ FC } from "react"
import { BrowserRouter as Router } from "react-router-dom"
import { SWRConfig } from "swr"
import { AppRouter } from "./AppRouter"
Expand All@@ -10,7 +10,7 @@ import { dark } from "./theme"
import "./theme/globalFonts"
import { XServiceProvider } from "./xServices/StateContext"

export const App:React.FC = () => {
export const App: FC = () => {
return (
<Router>
<SWRConfig
Expand Down
4 changes: 2 additions & 2 deletionssite/src/components/AuthAndFrame/AuthAndFrame.tsx
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
importReact from "react"
import{ FC } from "react"
import { Footer } from "../Footer/Footer"
import { Navbar } from "../Navbar/Navbar"
import { RequireAuth } from "../RequireAuth/RequireAuth"
Expand All@@ -10,7 +10,7 @@ interface AuthAndFrameProps {
/**
* Wraps page in RequireAuth and renders it between Navbar and Footer
*/
export const AuthAndFrame:React.FC<AuthAndFrameProps> = ({ children }) => (
export const AuthAndFrame: FC<AuthAndFrameProps> = ({ children }) => (
<RequireAuth>
<>
<Navbar />
Expand Down
1 change: 0 additions & 1 deletionsite/src/components/AvatarData/AvatarData.stories.tsx
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
import { Story } from "@storybook/react"
import React from "react"
import { AvatarData, AvatarDataProps } from "./AvatarData"

export default {
Expand Down
4 changes: 2 additions & 2 deletionssite/src/components/AvatarData/AvatarData.tsx
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
import Avatar from "@material-ui/core/Avatar"
import Link from "@material-ui/core/Link"
import { makeStyles } from "@material-ui/core/styles"
importReact from "react"
import{ FC } from "react"
import { Link as RouterLink } from "react-router-dom"
import { combineClasses } from "../../util/combineClasses"
import { firstLetter } from "../../util/firstLetter"
Expand All@@ -12,7 +12,7 @@ export interface AvatarDataProps {
link?: string
}

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

return (
Expand Down
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
import { Story } from "@storybook/react"
import React from "react"
import { BorderedMenuRow } from "../BorderedMenuRow/BorderedMenuRow"
import { BuildingIcon } from "../Icons/BuildingIcon"
import { UsersOutlinedIcon } from "../Icons/UsersOutlinedIcon"
Expand Down
4 changes: 2 additions & 2 deletionssite/src/components/BorderedMenu/BorderedMenu.tsx
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
import Popover, { PopoverProps } from "@material-ui/core/Popover"
import { fade, makeStyles } from "@material-ui/core/styles"
importReact from "react"
import{ FC } from "react"

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

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

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

return (
Expand Down
4 changes: 2 additions & 2 deletionssite/src/components/BorderedMenuRow/BorderedMenuRow.tsx
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -2,7 +2,7 @@ import ListItem from "@material-ui/core/ListItem"
import { makeStyles } from "@material-ui/core/styles"
import SvgIcon from "@material-ui/core/SvgIcon"
import CheckIcon from "@material-ui/icons/Check"
importReact from "react"
import{ FC } from "react"
import { NavLink } from "react-router-dom"
import { ellipsizeText } from "../../util/ellipsizeText"
import { Typography } from "../Typography/Typography"
Expand All@@ -26,7 +26,7 @@ interface BorderedMenuRowProps {
onClick?: () => void
}

export const BorderedMenuRow:React.FC<BorderedMenuRowProps> = ({
export const BorderedMenuRow: FC<BorderedMenuRowProps> = ({
active,
description,
Icon,
Expand Down
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
import { ComponentMeta, Story } from "@storybook/react"
import React from "react"
import { MockBuilds } from "../../testHelpers/entities"
import { BuildsTable, BuildsTableProps } from "./BuildsTable"

Expand Down
4 changes: 2 additions & 2 deletionssite/src/components/BuildsTable/BuildsTable.tsx
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -6,7 +6,7 @@ import TableCell from "@material-ui/core/TableCell"
import TableHead from "@material-ui/core/TableHead"
import TableRow from "@material-ui/core/TableRow"
import useTheme from "@material-ui/styles/useTheme"
importReact from "react"
import{ FC } from "react"
import { useNavigate } from "react-router-dom"
import * as TypesGen from "../../api/typesGenerated"
import { displayWorkspaceBuildDuration, getDisplayStatus } from "../../util/workspace"
Expand All@@ -27,7 +27,7 @@ export interface BuildsTableProps {
className?: string
}

export const BuildsTable:React.FC<BuildsTableProps> = ({ builds, className }) => {
export const BuildsTable: FC<BuildsTableProps> = ({ builds, className }) => {
const isLoading = !builds
const theme: Theme = useTheme()
const navigate = useNavigate()
Expand Down
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
import { Story } from "@storybook/react"
import React from "react"
import { CliAuthToken, CliAuthTokenProps } from "./CliAuthToken"

export default {
Expand Down
1 change: 0 additions & 1 deletionsite/src/components/CliAuthToken/CliAuthToken.test.tsx
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
import { screen } from "@testing-library/react"
import React from "react"
import { render } from "../../testHelpers/renderHelpers"
import { CliAuthToken } from "./CliAuthToken"

Expand Down
4 changes: 2 additions & 2 deletionssite/src/components/CliAuthToken/CliAuthToken.tsx
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
import Paper from "@material-ui/core/Paper"
import { makeStyles } from "@material-ui/core/styles"
import Typography from "@material-ui/core/Typography"
importReact from "react"
import{ FC } from "react"
import { CodeExample } from "../CodeExample/CodeExample"

export interface CliAuthTokenProps {
sessionToken: string
}

export const CliAuthToken:React.FC<CliAuthTokenProps> = ({ sessionToken }) => {
export const CliAuthToken: FC<CliAuthTokenProps> = ({ sessionToken }) => {
const styles = useStyles()
return (
<Paper className={styles.container}>
Expand Down
1 change: 0 additions & 1 deletionsite/src/components/CodeBlock/CodeBlock.stories.tsx
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
import { Story } from "@storybook/react"
import React from "react"
import { CodeBlock, CodeBlockProps } from "./CodeBlock"

const sampleLines = `Successfully assigned coder/image-jcws7 to cluster-1
Expand Down
1 change: 0 additions & 1 deletionsite/src/components/CodeBlock/CodeBlock.test.tsx
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
import { screen } from "@testing-library/react"
import React from "react"
import { render } from "../../testHelpers/renderHelpers"
import { CodeBlock } from "./CodeBlock"

Expand Down
8 changes: 4 additions & 4 deletionssite/src/components/CodeBlock/CodeBlock.tsx
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
import { makeStyles } from "@material-ui/core/styles"
importReact from "react"
import{ FC, Fragment, ReactElement } from "react"
import { MONOSPACE_FONT_FAMILY } from "../../theme/constants"
import { combineClasses } from "../../util/combineClasses"

export interface CodeBlockProps {
lines: string[]
ctas?:React.ReactElement[]
ctas?: ReactElement[]
className?: string
}

export const CodeBlock:React.FC<CodeBlockProps> = ({ lines, ctas, className = "" }) => {
export const CodeBlock: FC<CodeBlockProps> = ({ lines, ctas, className = "" }) => {
const styles = useStyles()

return (
Expand All@@ -24,7 +24,7 @@ export const CodeBlock: React.FC<CodeBlockProps> = ({ lines, ctas, className = "
{ctas && ctas.length && (
<div className={styles.ctaBar}>
{ctas.map((cta, i) => {
return <React.Fragment key={i}>{cta}</React.Fragment>
return <Fragment key={i}>{cta}</Fragment>
})}
</div>
)}
Expand Down
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
import { Story } from "@storybook/react"
import React from "react"
import { CodeExample, CodeExampleProps } from "./CodeExample"

const sampleCode = `echo "Hello, world"`
Expand Down
1 change: 0 additions & 1 deletionsite/src/components/CodeExample/CodeExample.test.tsx
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
import { screen } from "@testing-library/react"
import React from "react"
import { render } from "../../testHelpers/renderHelpers"
import { CodeExample } from "./CodeExample"

Expand Down
4 changes: 2 additions & 2 deletionssite/src/components/CodeExample/CodeExample.tsx
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
import { makeStyles } from "@material-ui/core/styles"
importReact from "react"
import{ FC } from "react"
import { MONOSPACE_FONT_FAMILY } from "../../theme/constants"
import { CopyButton } from "../CopyButton/CopyButton"

Expand All@@ -10,7 +10,7 @@ export interface CodeExampleProps {
/**
* Component to show single-line code examples, with a copy button
*/
export const CodeExample:React.FC<CodeExampleProps> = ({ code }) => {
export const CodeExample: FC<CodeExampleProps> = ({ code }) => {
const styles = useStyles()

return (
Expand Down
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
import { ComponentMeta, Story } from "@storybook/react"
import React from "react"
import { ConfirmDialog, ConfirmDialogProps } from "./ConfirmDialog"

export default {
Expand Down
4 changes: 2 additions & 2 deletionssite/src/components/ConfirmDialog/ConfirmDialog.test.tsx
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
import { fireEvent, render } from "@testing-library/react"
importReact from "react"
import{ FC } from "react"
import { act } from "react-dom/test-utils"
import { WrapperComponent } from "../../testHelpers/renderHelpers"
import { ConfirmDialog, ConfirmDialogProps } from "./ConfirmDialog"

namespace Helpers {
export const Component:React.FC<ConfirmDialogProps> = (props: ConfirmDialogProps) => {
export const Component: FC<ConfirmDialogProps> = (props: ConfirmDialogProps) => {
return (
<WrapperComponent>
<ConfirmDialog {...props} />
Expand Down
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
import { action } from "@storybook/addon-actions"
import { Story } from "@storybook/react"
import React from "react"
import { CreateUserForm, CreateUserFormProps } from "./CreateUserForm"

export default {
Expand Down
4 changes: 2 additions & 2 deletionssite/src/components/CreateUserForm/CreateUserForm.tsx
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
import FormHelperText from "@material-ui/core/FormHelperText"
import TextField from "@material-ui/core/TextField"
import { FormikContextType, FormikErrors, useFormik } from "formik"
importReact from "react"
import{ FC } from "react"
import * as Yup from "yup"
import * as TypesGen from "../../api/typesGenerated"
import { getFormHelpers, nameValidator, onChangeTrimmed } from "../../util/formUtils"
Expand DownExpand Up@@ -34,7 +34,7 @@ const validationSchema = Yup.object({
username: nameValidator(Language.usernameLabel),
})

export const CreateUserForm:React.FC<CreateUserFormProps> = ({
export const CreateUserForm: FC<CreateUserFormProps> = ({
onSubmit,
onCancel,
formErrors,
Expand Down
6 changes: 3 additions & 3 deletionssite/src/components/DropdownArrows/DropdownArrows.tsx
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
import { fade, makeStyles, Theme } from "@material-ui/core/styles"
import KeyboardArrowDown from "@material-ui/icons/KeyboardArrowDown"
import KeyboardArrowUp from "@material-ui/icons/KeyboardArrowUp"
importReact from "react"
import{ FC } from "react"

const useStyles = makeStyles((theme: Theme) => ({
arrowIcon: {
Expand All@@ -15,12 +15,12 @@ const useStyles = makeStyles((theme: Theme) => ({
},
}))

export const OpenDropdown:React.FC = () => {
export const OpenDropdown: FC = () => {
const styles = useStyles()
return <KeyboardArrowDown className={styles.arrowIcon} />
}

export const CloseDropdown:React.FC = () => {
export const CloseDropdown: FC = () => {
const styles = useStyles()
return <KeyboardArrowUp className={`${styles.arrowIcon} ${styles.arrowIconUp}`} />
}
1 change: 0 additions & 1 deletionsite/src/components/EmptyState/EmptyState.test.tsx
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
import { screen } from "@testing-library/react"
import React from "react"
import { render } from "../../testHelpers/renderHelpers"
import { EmptyState } from "./EmptyState"

Expand Down
6 changes: 3 additions & 3 deletionssite/src/components/EmptyState/EmptyState.tsx
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
import Box from "@material-ui/core/Box"
import { makeStyles } from "@material-ui/core/styles"
import Typography from "@material-ui/core/Typography"
importReact from "react"
import{ FC, ReactNode } from "react"

export interface EmptyStateProps {
/** Text Message to display, placed inside Typography component */
message: string
/** Longer optional description to display below the message */
description?: string
cta?:React.ReactNode
cta?: ReactNode
}

/**
Expand All@@ -19,7 +19,7 @@ export interface EmptyStateProps {
* EmptyState's props extend the [Material UI Box component](https://material-ui.com/components/box/)
* that you can directly pass props through to to customize the shape and layout of it.
*/
export const EmptyState:React.FC<EmptyStateProps> = (props) => {
export const EmptyState: FC<EmptyStateProps> = (props) => {
const { message, description, cta, ...boxProps } = props
const styles = useStyles()

Expand Down
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
import { Story } from "@storybook/react"
import React from "react"
import { EnterpriseSnackbar, EnterpriseSnackbarProps } from "./EnterpriseSnackbar"

export default {
Expand Down
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -2,7 +2,7 @@ import IconButton from "@material-ui/core/IconButton"
import Snackbar, { SnackbarProps as MuiSnackbarProps } from "@material-ui/core/Snackbar"
import { makeStyles } from "@material-ui/core/styles"
import CloseIcon from "@material-ui/icons/Close"
importReact from "react"
import{ FC } from "react"
import { combineClasses } from "../../util/combineClasses"

type EnterpriseSnackbarVariant = "error" | "info"
Expand All@@ -25,7 +25,7 @@ export interface EnterpriseSnackbarProps extends MuiSnackbarProps {
*
* See original component's Material UI documentation here: https://material-ui.com/components/snackbars/
*/
export const EnterpriseSnackbar:React.FC<EnterpriseSnackbarProps> = ({
export const EnterpriseSnackbar: FC<EnterpriseSnackbarProps> = ({
onClose,
variant = "info",
ContentProps = {},
Expand Down
Loading

[8]ページ先頭

©2009-2025 Movatter.jp