Skip to content
  •  
  •  
  •  
4 changes: 4 additions & 0 deletions .oxlintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,10 @@
"files": ["scripts/**/*", "examples/functions/**/*"],
"rules": {"no-console": "off", "no-unsafe-type-assertion": "off"}
},
{
"files": ["dev/**/*.{ts,tsx,js,jsx}", "perf/**/*.{ts,tsx,js,jsx}"],
"rules": {"typescript/explicit-module-boundary-types": "off"}
},
{
"files": ["**/*.test.{ts,tsx,cjs,mjs,js,jsx}", "**/__workshop__/**"],
"rules": {
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
Expand Up @@ -2,7 +2,7 @@ import {Button, Card, Code, Stack} from '@sanity/ui'
import {useCallback} from 'react'
import {usePaneRouter} from 'sanity/structure'

export function CustomPane(props: any) {
export function CustomPane(props: any) : React.JSX.Element {
return (
<Card height="fill" tone="transparent">
<Stack padding={2} space={1}>
Expand Down
2 changes: 1 addition & 1 deletion dev/design-studio/components/IframeView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ const IFrame = styled.iframe`
border: 0;
`

export function IFrameView() {
export function IFrameView() : React.JSX.Element {
return <IFrame src="https://www.sanity.io/" />
}
2 changes: 1 addition & 1 deletion dev/design-studio/components/jsonPreview.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import {Card, Code} from '@sanity/ui'

export function JSONPreviewDocumentView(props: any) {
export function JSONPreviewDocumentView(props: any) : React.JSX.Element {
return (
<Card padding={4} sizing="border" style={{minHeight: '100%'}} tone="transparent">
<Code language="json">{JSON.stringify(props.document.displayed, null, 2)}</Code>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const Thing = styled.div`
box-sizing: border-box;
`

export function StyledTestView() {
export function StyledTestView() : React.JSX.Element {
// throw new Error('called?')

return (
Expand Down
2 changes: 1 addition & 1 deletion dev/test-studio/components/AudienceSelectInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {DECISION_PARAMETERS_SCHEMA, set, type StringInputProps, unset, useWorksp
/**
* Custom input component for audience selection that reads from sanity.config
*/
export function AudienceSelectInput(props: StringInputProps) {
export function AudienceSelectInput(props: StringInputProps) : React.JSX.Element {
const {value, onChange} = props
const decisionParametersConfig = useWorkspace().__internal.options[DECISION_PARAMETERS_SCHEMA]

Expand Down
2 changes: 1 addition & 1 deletion dev/test-studio/components/PerspectiveExample.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ interface Document {
number?: number
}

export const PerspectiveExample = (props: {options: {doc$: Observable<Document>}}) => {
export const PerspectiveExample = (props: {options: {doc$: Observable<Document>}}) : React.JSX.Element => {
const {options} = props
const doc$ = options.doc$
const [doc, setDoc] = useState<Document | null>(null)
Expand Down
2 changes: 1 addition & 1 deletion dev/test-studio/components/deskTool/LanguageFilter.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import {type SchemaType} from '@sanity/types'
import {Card, Text} from '@sanity/ui'

export function LanguageFilter(props: {schemaType: SchemaType}) {
export function LanguageFilter(props: {schemaType: SchemaType}) : React.JSX.Element {
return (
<Card border padding={3} radius={2}>
<div style={{margin: -1}}>
Expand Down
2 changes: 1 addition & 1 deletion dev/test-studio/components/documentViews/jsonPreview.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import {Box, Card, Code} from '@sanity/ui'

export function JSONPreviewDocumentView(props: any) {
export function JSONPreviewDocumentView(props: any) : React.JSX.Element {
return (
<Card overflow="auto" style={{minHeight: '100%'}} tone="transparent">
<Box padding={4}>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {
type RenderInputCallback,
} from 'sanity'

export function FormInputExample(props: ObjectInputProps) {
export function FormInputExample(props: ObjectInputProps) : React.JSX.Element {
const [path, setPath] = useState<Path>([])

const [includeField, setIncludeField] = useState(false)
Expand Down
16 changes: 8 additions & 8 deletions dev/test-studio/components/formComponents.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,39 +9,39 @@ import {
type PreviewProps,
} from 'sanity'

export function Input(props: InputProps) {
export function Input(props: InputProps) : React.JSX.Element {
return (
<Card data-testid="input-config-component" padding={2} border tone="primary">
{props.renderDefault(props)}
</Card>
)
}

export function Field(props: FieldProps) {
export function Field(props: FieldProps) : React.JSX.Element {
return (
<Card data-testid="field-config-component" padding={2} border tone="caution">
{props.renderDefault(props)}
</Card>
)
}

export function Item(props: ItemProps) {
export function Item(props: ItemProps) : React.JSX.Element {
return (
<Card data-testid="item-config-component" padding={2} border tone="positive">
{props.renderDefault(props)}
</Card>
)
}

export function Block(props: BlockProps) {
export function Block(props: BlockProps) : React.JSX.Element {
return (
<Card data-testid="block-config-component" padding={2} border tone="positive">
{props.renderDefault(props)}
</Card>
)
}

export function InlineBlock(props: BlockProps) {
export function InlineBlock(props: BlockProps) : React.JSX.Element {
return (
<Card
data-testid="inline-block-config-component"
Expand All @@ -55,7 +55,7 @@ export function InlineBlock(props: BlockProps) {
)
}

export function Annotation(props: BlockAnnotationProps) {
export function Annotation(props: BlockAnnotationProps) : React.JSX.Element {
return (
<Card
data-testid="annotation-config-component"
Expand All @@ -69,15 +69,15 @@ export function Annotation(props: BlockAnnotationProps) {
)
}

export function Preview(props: PreviewProps) {
export function Preview(props: PreviewProps) : React.JSX.Element {
return (
<Card data-testid="preview-config-component" padding={2} border tone="critical">
{props.renderDefault(props)}
</Card>
)
}

export function CustomBadge() {
export function CustomBadge() : React.JSX.Element {
return {
label: 'Hello world',
title: 'Hello I am a custom document badge',
Expand Down
2 changes: 1 addition & 1 deletion dev/test-studio/components/navbar/ToolMenu.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import {Button, Flex} from '@sanity/ui'
import {ToolLink, type ToolMenuProps} from 'sanity'

export function ToolMenu(props: ToolMenuProps) {
export function ToolMenu(props: ToolMenuProps) : React.JSX.Element {
const {context, tools, closeSidebar} = props

return (
Expand Down
8 changes: 4 additions & 4 deletions dev/test-studio/components/studioComponents.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export const studioComponentsPlugin = definePlugin({
const TitleContext = createContext<string>('')
const useTitleContext = () => useContext(TitleContext)

export function CustomLayout(props: LayoutProps) {
export function CustomLayout(props: LayoutProps) : React.JSX.Element {
const {renderDefault} = props

return (
Expand All @@ -43,14 +43,14 @@ export function CustomLayout(props: LayoutProps) {
}

// Logo
export function CustomLogo(props: LogoProps) {
export function CustomLogo(props: LogoProps) : React.JSX.Element {
const title = useTitleContext()

return props.renderDefault({...props, title})
}

// Navbar
export function CustomNavbar(props: NavbarProps) {
export function CustomNavbar(props: NavbarProps) : React.JSX.Element {
return (
<Stack data-testid="test-navbar-config">
<Card padding={4} tone="primary" data-testid="test-navbar-banner-config">
Expand All @@ -68,7 +68,7 @@ export function CustomNavbar(props: NavbarProps) {
}

// ToolMenu
export function CustomToolMenu(props: ToolMenuProps) {
export function CustomToolMenu(props: ToolMenuProps) : React.JSX.Element {
return (
<Card
data-testid="test-tool-menu-config"
Expand Down
2 changes: 1 addition & 1 deletion dev/test-studio/fieldActions/PrivateIcon.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import {LockIcon} from '@sanity/icons'
import {Text, Tooltip} from '@sanity/ui'

export function PrivateIcon() {
export function PrivateIcon() : React.JSX.Element {
return (
<Tooltip
content={
Expand Down
2 changes: 1 addition & 1 deletion dev/test-studio/inspectors/custom/inspector.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import {Box, Card, Flex, Text} from '@sanity/ui'
import {type DocumentInspectorProps} from 'sanity'
import {DocumentInspectorHeader} from 'sanity/structure'

export function CustomInspector(props: DocumentInspectorProps) {
export function CustomInspector(props: DocumentInspectorProps) : React.JSX.Element {
const {onClose} = props

return (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ function triggerPromiseError() {
})
}

export function ErrorReportingTest() {
export function ErrorReportingTest() : React.JSX.Element {
const [doRenderError, setRenderError] = useState(false)
const handleShouldRenderWithError = useCallback(() => setRenderError(true), [])
const [triggerReactLazyImportError, setTriggerReactLazyImportError] = useState(false)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export interface LanguageFilterMenuButtonProps {
schemaType: ObjectSchemaType
}

export function LanguageFilterMenuButton(props: LanguageFilterMenuButtonProps) {
export function LanguageFilterMenuButton(props: LanguageFilterMenuButtonProps) : React.JSX.Element {
const {options} = props
const defaultLanguages = options.supportedLanguages.filter((l) =>
options.defaultLanguages?.includes(l.id),
Expand Down
2 changes: 1 addition & 1 deletion dev/test-studio/plugins/router-debug/RouterDebug.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import {Button, Card, Code, Flex, Stack, Text} from '@sanity/ui'
import {useClient} from 'sanity'
import {IntentLink, RouteScope, StateLink, useRouter, useStateLink} from 'sanity/router'

export function RouterDebug() {
export function RouterDebug() : React.JSX.Element {
const {navigate} = useRouter()

const link = useStateLink({
Expand Down
2 changes: 1 addition & 1 deletion dev/test-studio/schema/debug/PageBlockAnchor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import {Box, Button, Flex, useToast} from '@sanity/ui'
import {useCallback} from 'react'
import {type ObjectItemProps, type Slug, useFormValue} from 'sanity'

export function PageBlockAnchor(props: ObjectItemProps) {
export function PageBlockAnchor(props: ObjectItemProps) : React.JSX.Element {
const slug = useFormValue(['slug']) as Slug | undefined
const toast = useToast()

Expand Down
2 changes: 1 addition & 1 deletion dev/test-studio/schema/debug/components/CreateDraft.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import {useCallback, useState} from 'react'
import {getDraftId, useClient} from 'sanity'
import {useDocumentPane} from 'sanity/structure'

export function CreateDraft() {
export function CreateDraft() : React.JSX.Element {
const {documentId, documentType, value, editState} = useDocumentPane()

const client = useClient({apiVersion: '2025-01-30'})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import {set, type StringInputProps} from 'sanity'

import styles from './CustomFontStringInput.module.css'

export default function CustomFontStringInput(props: StringInputProps) {
export default function CustomFontStringInput(props: StringInputProps) : React.JSX.Element {
const {value, schemaType, onChange} = props
return (
<div>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import {type ObjectInputProps, set, setIfMissing} from 'sanity'

export default function CustomMyObjectInput(props: ObjectInputProps) {
export default function CustomMyObjectInput(props: ObjectInputProps) : React.JSX.Element {
const {value, schemaType, onChange} = props
return (
<div style={{backgroundColor: '#f5ad3d'}}>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import {set, type StringInputProps} from 'sanity'

export default function CustomStringInput(props: StringInputProps) {
export default function CustomStringInput(props: StringInputProps) : React.JSX.Element {
const {value, schemaType, onChange} = props

return (
Expand Down
2 changes: 1 addition & 1 deletion dev/test-studio/schema/debug/components/DebugStega.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {type InputProps, isDocumentSchemaType} from 'sanity'
import {useDocumentPane, usePaneRouter} from 'sanity/structure'
import {styled} from 'styled-components'

export function StegaDebugger(props: InputProps) {
export function StegaDebugger(props: InputProps) : React.JSX.Element {
if (isDocumentSchemaType(props.schemaType)) {
return (
<Stack space={2}>
Expand Down
Loading