Skip to content

Commit

Permalink
fix: remove unused React import
Browse files Browse the repository at this point in the history
  • Loading branch information
stipsan committed Oct 24, 2023
1 parent f81e301 commit 4bb8168
Show file tree
Hide file tree
Showing 858 changed files with 529 additions and 945 deletions.
1 change: 1 addition & 0 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ const baseConfig = {
additionalHooks: '(useMemoObservable|useObservableCallback|useAsync)',
},
],
'react/no-unescaped-entities': 'off',
},
settings: {
'import/extensions': ['.cjs', '.mjs', '.js', '.jsx', '.ts', '.tsx'],
Expand Down
2 changes: 1 addition & 1 deletion dev/design-studio/components/CustomPane/CustomPane.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, {useCallback} from 'react'
import {useCallback} from 'react'
import {Button, Card, Code, Stack} from '@sanity/ui'
import {usePaneRouter} from 'sanity/desk'

Expand Down
1 change: 0 additions & 1 deletion dev/design-studio/components/IframeView.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import React from 'react'
import styled from 'styled-components'

const IFrame = styled.iframe`
Expand Down
1 change: 0 additions & 1 deletion dev/design-studio/components/jsonPreview.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import {Card, Code} from '@sanity/ui'
import React from 'react'

export function JSONPreviewDocumentView(props: any) {
return (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import {
ThemeColorSolidTone,
useRootTheme,
} from '@sanity/ui'
import React, {createContext, useContext, useMemo} from 'react'
import {createContext, useContext, useMemo} from 'react'

interface Features {
button: boolean
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import React from 'react'
import styled from 'styled-components'

const Thing = styled.div`
Expand Down
1 change: 1 addition & 0 deletions dev/starter-cra-studio/src/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/* eslint-disable react/jsx-filename-extension */

// eslint-disable-next-line no-unused-vars
import React, {StrictMode} from 'react'
import {createRoot} from 'react-dom/client'
// eslint-disable-next-line import/no-unassigned-import
Expand Down
1 change: 0 additions & 1 deletion dev/strict-studio/_document.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import React from 'react'
import {DefaultDocument} from 'sanity'

export default function Document(props) {
Expand Down
2 changes: 1 addition & 1 deletion dev/strict-studio/entry.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, {StrictMode} from 'react'
import {StrictMode} from 'react'
import {createRoot} from 'react-dom/client'
import {Studio} from 'sanity'
import config from './sanity.config'
Expand Down
2 changes: 1 addition & 1 deletion dev/test-next-studio/app/registry.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

'use client'

import React, {useState} from 'react'
import {useState} from 'react'
import {useServerInsertedHTML} from 'next/navigation'
import {ServerStyleSheet, StyleSheetManager} from 'styled-components'

Expand Down
1 change: 0 additions & 1 deletion dev/test-studio/assetSources/imageAssetSource.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import {ImagesIcon} from '@sanity/icons'
import {AssetSource, AssetSourceComponentProps} from '@sanity/types'
import {Box, Dialog, Text} from '@sanity/ui'
import React from 'react'

function ImageAssetSource(props: AssetSourceComponentProps) {
const {dialogHeaderTitle, onClose, ...restProps} = props
Expand Down
1 change: 0 additions & 1 deletion dev/test-studio/components/Branding.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import {Box, Text} from '@sanity/ui'
import React from 'react'

export function Branding() {
return (
Expand Down
1 change: 0 additions & 1 deletion dev/test-studio/components/deskTool/LanguageFilter.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import {SchemaType} from '@sanity/types'
import {Card, Text} from '@sanity/ui'
import React from 'react'

export function LanguageFilter(props: {schemaType: SchemaType}) {
return (
Expand Down
1 change: 0 additions & 1 deletion dev/test-studio/components/documentViews/jsonPreview.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import {Card, Code} from '@sanity/ui'
import React from 'react'

export function JSONPreviewDocumentView(props: any) {
return (
Expand Down
2 changes: 0 additions & 2 deletions dev/test-studio/components/formBuilder/ArrayFunctions.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import React from 'react'

export const ArrayFunctions: any = () => {
return <div>ArrayFunctions</div>
}
2 changes: 0 additions & 2 deletions dev/test-studio/components/formBuilder/CustomMarkers.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import React from 'react'

export const CustomMarkers: any = () => {
return <div>CustomMarkers</div>
}
2 changes: 0 additions & 2 deletions dev/test-studio/components/formBuilder/Markers.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import React from 'react'

export const Markers: any = () => {
return <div>CustomMarkers</div>
}
1 change: 0 additions & 1 deletion dev/test-studio/components/formComponents.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import React from 'react'
import {Card} from '@sanity/ui'
import {
definePlugin,
Expand Down
1 change: 0 additions & 1 deletion dev/test-studio/components/navbar/ToolMenu.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import {Button, Flex} from '@sanity/ui'
import React from 'react'
import {ToolLink, ToolMenuProps} from 'sanity'

export function ToolMenu(props: ToolMenuProps) {
Expand Down
9 changes: 1 addition & 8 deletions dev/test-studio/components/panes/JsonDocumentDump.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,7 @@
import {useClient} from 'sanity'
import {SanityDocument} from '@sanity/types'
import {Box, Code, Flex, Spinner, Text} from '@sanity/ui'
import React, {
forwardRef,
useCallback,
useEffect,
useImperativeHandle,
useRef,
useState,
} from 'react'
import {forwardRef, useCallback, useEffect, useImperativeHandle, useRef, useState} from 'react'
import {Subscription} from 'rxjs'

export const JsonDocumentDump = forwardRef(function JsonDocumentDump(
Expand Down
2 changes: 1 addition & 1 deletion dev/test-studio/components/panes/debug/DebugPane.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import {UserComponent, usePaneRouter} from 'sanity/desk'
import {ChevronDownIcon, ChevronRightIcon, ControlsIcon, LinkIcon} from '@sanity/icons'
import {Box, Card, Code, Flex, Stack, Text} from '@sanity/ui'
import React, {useMemo} from 'react'
import {useMemo} from 'react'

function usePaneChildLinkComponent(props: {
id: string
Expand Down
2 changes: 1 addition & 1 deletion dev/test-studio/components/studioComponents.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, {createContext, useContext} from 'react'
import {createContext, useContext} from 'react'
import {Box, Card, Flex, Stack, Text} from '@sanity/ui'
import {LogoProps, NavbarProps, LayoutProps, definePlugin, ToolMenuProps} from 'sanity'

Expand Down
1 change: 0 additions & 1 deletion dev/test-studio/components/workspaceLogos.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import React from 'react'
import {useColorScheme} from 'sanity'

export const VercelLogo = () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import {DocumentActionComponent, DocumentActionDescription} from 'sanity'
import {CheckmarkCircleIcon, CloseCircleIcon} from '@sanity/icons'
import {Button, Text, useToast} from '@sanity/ui'
import React, {useCallback, useMemo, useState} from 'react'
import {useCallback, useMemo, useState} from 'react'

export const TestConfirmDialogAction: DocumentActionComponent = (props) => {
const {onComplete} = props
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import {Button, Card, Dialog, Stack, Text} from '@sanity/ui'
import {DocumentActionComponent} from 'sanity'
import React, {useCallback, useState} from 'react'
import {useCallback, useState} from 'react'

export const TestCustomComponentAction: DocumentActionComponent = () => {
const [open, setOpen] = useState<boolean>(false)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import {DocumentActionComponent, DocumentActionDescription} from 'sanity'
import {CopyIcon} from '@sanity/icons'
import {Button, Grid, Text, useToast} from '@sanity/ui'
import React, {useCallback, useMemo, useState} from 'react'
import {useCallback, useMemo, useState} from 'react'

export const TestModalDialogAction: DocumentActionComponent = (props) => {
const {onComplete} = props
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import {DocumentActionComponent, DocumentActionDescription} from 'sanity'
import {LaunchIcon} from '@sanity/icons'
import {Button, Stack, Text, useToast} from '@sanity/ui'
import React, {useCallback, useMemo, useState} from 'react'
import {useCallback, useMemo, useState} from 'react'

export const TestPopoverDialogAction: DocumentActionComponent = (props) => {
const {onComplete} = props
Expand Down
1 change: 0 additions & 1 deletion dev/test-studio/fieldActions/PrivateIcon.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import {LockIcon} from '@sanity/icons'
import {Text, Tooltip} from '@sanity/ui'
import React from 'react'

export function PrivateIcon() {
return (
Expand Down
1 change: 0 additions & 1 deletion dev/test-studio/inspectors/custom/inspector.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import {Box, Card, Flex, Text} from '@sanity/ui'
import React from 'react'
import {DocumentInspectorProps} from 'sanity'
import {DocumentInspectorHeader} from 'sanity/desk'

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import {TranslateIcon} from '@sanity/icons'
import {Box, Button, Card, Checkbox, Flex, Popover, Stack, Text, useClickOutside} from '@sanity/ui'
import React, {FormEvent, useCallback, useState} from 'react'
import {FormEvent, useCallback, useState} from 'react'
import {ObjectSchemaType} from 'sanity'
import {LanguageFilterPluginOptions} from './types'
import {usePaneLanguages} from './usePaneLanguages'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {pathFor} from '@sanity/util/paths'
import React, {useMemo} from 'react'
import {useMemo} from 'react'
import {
FieldError,
FieldMember,
Expand Down
1 change: 0 additions & 1 deletion dev/test-studio/plugins/language-filter/plugin.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import React from 'react'
import {definePlugin, ObjectInputProps, _DocumentLanguageFilterComponent} from 'sanity'
import {LanguageFilterMenuButton} from './LanguageFilterMenuButton'
import {LanguageFilterObjectInput} from './LanguageFilterObjectInput'
Expand Down
2 changes: 1 addition & 1 deletion dev/test-studio/plugins/presence/Presence3D.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/* eslint-disable react/no-unknown-property */
// Fork of https://codesandbox.io/s/object-clump-ssbdsw

import React, {memo, useState} from 'react'
import {memo, useState} from 'react'

import {Physics, useCylinder, useSphere} from '@react-three/cannon'
import {Effects as EffectComposer, Environment, Sky, useTexture} from '@react-three/drei'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import {ObjectInputProps, set, setIfMissing, unset, useClient} from 'sanity'
import imageUrlBuilder from '@sanity/image-url'
import {Reference, ReferenceSchemaType} from '@sanity/types'
import {Button, Spinner} from '@sanity/ui'
import React, {forwardRef, useEffect, useImperativeHandle, useMemo, useRef, useState} from 'react'
import {forwardRef, useEffect, useImperativeHandle, useMemo, useRef, useState} from 'react'
import styles from './AuthorReferenceInput.module.css'

const noop = () => null
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import {set, StringInputProps} from 'sanity'
import React from 'react'
import styles from './CustomFontStringInput.module.css'

export default class CustomStringInput extends React.Component<StringInputProps> {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, {useCallback} from 'react'
import {useCallback} from 'react'
import {range} from 'lodash'
import {FieldPresence, ObjectInputProps, PresenceScope, set, setIfMissing} from 'sanity'

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import React from 'react'
import {DocumentPresence, FieldPresence, PresenceOverlay, setIfMissing} from 'sanity'
import {Button, Dialog} from '@sanity/ui'
import {ObjectSchemaType, Path} from '@sanity/types'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import React from 'react'
import {ObjectInputProps, set, setIfMissing} from 'sanity'

export default class CustomMyObjectInput extends React.Component<ObjectInputProps> {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import {ObjectInputProps, ObjectSchemaType, set, unset, isValidationError} from 'sanity'
import {Select} from '@sanity/ui'
import React, {useCallback, useState} from 'react'
import {useCallback, useState} from 'react'

type Value = {title: string; value: string}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import React from 'react'
import {set, StringInputProps} from 'sanity'

export default class CustomStringInput extends React.Component<StringInputProps> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ import {
UrlInput,
UrlInputProps,
} from 'sanity'
import React, {ReactNode} from 'react'
import {ReactNode} from 'react'
import {Card} from '@sanity/ui'

/* These ensure that all the native inputs are exported and assignable to defineField.components.input*/
Expand Down
2 changes: 1 addition & 1 deletion dev/test-studio/schema/debug/customInputsWithPatches.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {Button, Grid} from '@sanity/ui'
import React, {useCallback, useEffect, useRef} from 'react'
import {useCallback, useEffect, useRef} from 'react'
import {defineField, ObjectInputProps, Path, set, unset} from 'sanity'

/**
Expand Down
1 change: 0 additions & 1 deletion dev/test-studio/schema/debug/fieldComponentsTest.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import React from 'react'
import styled from 'styled-components'

const CustomBox = styled.div`
Expand Down
1 change: 0 additions & 1 deletion dev/test-studio/schema/debug/formInputDebug.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import React from 'react'
import {FormInput, ObjectInputProps} from 'sanity'
import {Grid} from '@sanity/ui'

Expand Down
1 change: 0 additions & 1 deletion dev/test-studio/schema/debug/readOnly.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
// import {MdTextFormat as icon} from 'react-icons/md'
import React from 'react'

export default {
name: 'readOnlyTest',
Expand Down
1 change: 0 additions & 1 deletion dev/test-studio/schema/debug/scrollBug.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import {
RocketIcon,
TrendUpwardIcon,
} from '@sanity/icons'
import React from 'react'
import {Stack, Text} from '@sanity/ui'

export const articleImage = defineType({
Expand Down
1 change: 0 additions & 1 deletion dev/test-studio/schema/debug/virtualizationDebug.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import React from 'react'
import {FieldProps, SanityClient, defineField, defineType} from 'sanity'

interface Author {
Expand Down
2 changes: 1 addition & 1 deletion dev/test-studio/schema/demos/3d/torus-knot/ColorInput.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {Stack, Text} from '@sanity/ui'
import React, {useCallback} from 'react'
import {useCallback} from 'react'
import {transparentize} from 'polished'
import styled from 'styled-components'
import {StringInputProps, set} from 'sanity'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import {ObjectInputProps} from 'sanity'
import {Stack, Skeleton} from '@sanity/ui'
import React, {lazy, Suspense} from 'react'
import {lazy, Suspense} from 'react'
import styled from 'styled-components'

const TorusKnotInputPreview = lazy(() => import('./TorusKnotInputPreview'))
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {Box} from '@sanity/ui'
import React, {memo, Suspense, useRef} from 'react'
import {memo, Suspense, useRef} from 'react'
import styled from 'styled-components'
import {Canvas, Vector3} from '@react-three/fiber'
import View from './TorusKnotScene'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, {lazy, memo, Suspense} from 'react'
import {lazy, memo, Suspense} from 'react'
import {Skeleton, Stack, TextSkeleton} from '@sanity/ui'

const TorusKnotPreview = lazy(() => import('./TorusKnotPreview'))
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {Canvas, Vector3} from '@react-three/fiber'
import React, {memo, startTransition, Suspense, useEffect, useRef, useState} from 'react'
import {memo, startTransition, Suspense, useEffect, useRef, useState} from 'react'
import styled from 'styled-components'
import {Box} from '@sanity/ui'

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import {Environment, OrbitControls} from '@react-three/drei'
import {useFrame, useThree} from '@react-three/fiber'
import {Color, Depth, Fresnel, LayerMaterial} from 'lamina'
import React, {memo, useEffect, useRef} from 'react'
import {memo, useEffect, useRef} from 'react'
import * as THREE from 'three'

export default function View({element: {base, colorA, colorB, position}, preview = false}: any) {
Expand Down
1 change: 0 additions & 1 deletion dev/test-studio/schema/demos/3d/torus-knot/schemaType.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import React from 'react'
import {defineType} from 'sanity'
import {structureGroupOptions} from '../../../../structure/groupByOption'
import TorusKnotInput from './TorusKnotInput'
Expand Down
1 change: 0 additions & 1 deletion dev/test-studio/schema/docs/v3/example1/CodeInput.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import {FieldMember, MemberField, ObjectInputProps} from 'sanity'
import {Stack} from '@sanity/ui'
import React from 'react'

export function CodeInput(props: ObjectInputProps) {
const {members, renderField, renderItem} = props
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, {useCallback} from 'react'
import {useCallback} from 'react'
import {hues} from '@sanity/color'
import {Box, Stack, Heading, Flex, Inline, Text, Grid, Button} from '@sanity/ui'
import {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import React from 'react'
import {defineType} from 'sanity'
import {structureGroupOptions} from '../../../../structure/groupByOption'
import {
Expand Down
1 change: 0 additions & 1 deletion dev/test-studio/schema/plugins/color.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
/* eslint-disable react/display-name */

import {DropIcon} from '@sanity/icons'
import React from 'react'
import {defineType} from 'sanity'

export default defineType({
Expand Down
Loading

0 comments on commit 4bb8168

Please sign in to comment.