Skip to content

Commit

Permalink
chore: manually fix remaining non-autofixable eslint issues
Browse files Browse the repository at this point in the history
  • Loading branch information
bjoerge committed Jan 20, 2024
1 parent b96ff98 commit 8e49737
Show file tree
Hide file tree
Showing 25 changed files with 86 additions and 85 deletions.
1 change: 1 addition & 0 deletions dev/embedded-studio/src/main.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import React from 'react'
import ReactDOM from 'react-dom/client'
// eslint-disable-next-line import/no-unassigned-import
import './index.css'
import {App} from './App'

Expand Down
2 changes: 1 addition & 1 deletion dev/test-studio/sanity.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ import {
} from './components/studioComponents'
import {GoogleLogo, TailwindLogo, VercelLogo} from './components/workspaceLogos'
import {resolveDocumentActions as documentActions} from './documentActions'
import {copyAction} from './fieldActions/copyAction'
import {assistFieldActionGroup} from './fieldActions/assistFieldActionGroup'
import {copyAction} from './fieldActions/copyAction'
import {pasteAction} from './fieldActions/pasteAction'
import {resolveInitialValueTemplates} from './initialValueTemplates'
import {customInspector} from './inspectors/custom'
Expand Down
34 changes: 17 additions & 17 deletions packages/@sanity/cli/src/actions/init-project/initProject.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,28 @@ import which from 'which'
import {CLIInitStepCompleted} from '../../__telemetry__/init.telemetry'
import {type InitFlags} from '../../commands/init/initCommand'
import {debug} from '../../debug'
import {
getPackageManagerChoice,
installDeclaredPackages,
installNewPackages,
} from '../../packageManager'
import {getPartialEnvWithNpmPath, PackageManager} from '../../packageManager/packageManagerChoice'
import {
CliApiClient,
CliCommandArguments,
CliCommandContext,
CliCommandDefinition,
SanityCore,
SanityModuleInternal,
} from '../../types'
import {getClientWrapper} from '../../util/clientWrapper'
import {dynamicRequire} from '../../util/dynamicRequire'
import {getProjectDefaults, ProjectDefaults} from '../../util/getProjectDefaults'
import {getUserConfig} from '../../util/getUserConfig'
import {isCommandGroup} from '../../util/isCommandGroup'
import {isInteractive} from '../../util/isInteractive'
import {login, LoginFlags} from '../login/login'
import {createProject} from '../project/createProject'
import {
getPackageManagerChoice,
installDeclaredPackages,
installNewPackages,
} from '../../packageManager'
import {BootstrapOptions, bootstrapTemplate} from './bootstrapTemplate'
import {GenerateConfigOptions} from './createStudioConfig'
import {absolutify, validateEmptyPath} from './fsUtils'
Expand All @@ -39,6 +50,7 @@ import {
promptForNextTemplate,
promptForStudioPath,
} from './prompts/nextjs'
import {reconfigureV2Project} from './reconfigureV2Project'
import templates from './templates'
import {
sanityCliTemplate,
Expand All @@ -47,18 +59,6 @@ import {
sanityStudioAppTemplate,
sanityStudioPagesTemplate,
} from './templates/nextjs'
import {reconfigureV2Project} from './reconfigureV2Project'
import {getPartialEnvWithNpmPath, PackageManager} from '../../packageManager/packageManagerChoice'
import {
CliApiClient,
CliCommandArguments,
CliCommandContext,
CliCommandDefinition,
SanityCore,
SanityModuleInternal,
} from '../../types'
import {getClientWrapper} from '../../util/clientWrapper'
import {dynamicRequire} from '../../util/dynamicRequire'

// eslint-disable-next-line no-process-env
const isCI = process.env.CI
Expand Down
8 changes: 4 additions & 4 deletions packages/@sanity/cli/src/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,15 @@ import {CliCommand} from './__telemetry__/cli.telemetry'
import {baseCommands} from './commands'
import {debug} from './debug'
import {getInstallCommand} from './packageManager'
import {CommandRunnerOptions, TelemetryUserProperties} from './types'
import {createTelemetryStore} from './util/createTelemetryStore'
import {detectRuntime} from './util/detectRuntime'
import {CliConfigResult, getCliConfig} from './util/getCliConfig'
import {loadEnv} from './util/loadEnv'
import {mergeCommands} from './util/mergeCommands'
import {parseArguments} from './util/parseArguments'
import {neatStack} from './util/neatStack'
import {parseArguments} from './util/parseArguments'
import {resolveRootDir} from './util/resolveRootDir'
import {CommandRunnerOptions, TelemetryUserProperties} from './types'
import {createTelemetryStore} from './util/createTelemetryStore'
import {detectRuntime} from './util/detectRuntime'
import {telemetryDisclosure} from './util/telemetryDisclosure'
import {runUpdateCheck} from './util/updateNotifier'

Expand Down
2 changes: 1 addition & 1 deletion packages/@sanity/import/src/importFromFolder.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
const fs = require('fs')
const path = require('path')
const debug = require('debug')('sanity:import:folder')
const getFileUrl = require('file-url')
const globby = require('globby')
const debug = require('debug')('sanity:import:folder')
const readJson = require('./util/readJson')
const rimraf = require('./util/rimraf')

Expand Down
2 changes: 1 addition & 1 deletion packages/@sanity/import/src/references.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
const {extractWithPath} = require('@sanity/mutator')
const debug = require('debug')('sanity:import')
const {get} = require('lodash')
const pMap = require('p-map')
const {extractWithPath} = require('@sanity/mutator')
const serializePath = require('./serializePath')
const progressStepper = require('./util/progressStepper')
const retryOnFailure = require('./util/retryOnFailure')
Expand Down
2 changes: 1 addition & 1 deletion packages/@sanity/import/src/uploadAssets.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
const basename = require('path').basename
const parseUrl = require('url').parse
const {isSanityImageUrl} = require('@sanity/asset-utils')
const debug = require('debug')('sanity:import')
const pMap = require('p-map')
const {isSanityImageUrl} = require('@sanity/asset-utils')
const getHashedBufferForUri = require('./util/getHashedBufferForUri')
const progressStepper = require('./util/progressStepper')
const retryOnFailure = require('./util/retryOnFailure')
Expand Down
2 changes: 1 addition & 1 deletion packages/@sanity/import/src/validateAssetDocuments.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const debug = require('debug')('sanity:import:asset-validation')
const {generateHelpUrl} = require('@sanity/generate-help-url')
const debug = require('debug')('sanity:import:asset-validation')
const pMap = require('p-map')
const urlExists = require('./util/urlExists')

Expand Down
2 changes: 1 addition & 1 deletion packages/@sanity/types/src/schema/definition/type/block.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import {type ComponentType, type ReactNode} from 'react'
import {type RuleDef, type ValidationBuilder} from '../../ruleBuilder'
import {type InitialValueProperty} from '../../types'
import {type ArrayOfType} from './array'
import {type ArrayOfType} from './array'
import {type BaseSchemaDefinition} from './common'
import {type ObjectDefinition} from './object'

Expand Down
4 changes: 2 additions & 2 deletions packages/@sanity/types/src/schema/types.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import {type SanityClient} from '@sanity/client'
import {type ComponentType} from 'react'
import {type SanityDocument} from '../documents'
import {type CurrentUser} from '../user'
import {type Rule} from '../validation'
import {type SchemaTypeDefinition} from './definition/schemaDefinition'
import {
type BlockDecoratorDefinition,
Expand All @@ -18,8 +20,6 @@ import {
} from './definition/type'
import {type ArrayOptions} from './definition/type/array'
import {type PreviewConfig} from './preview'
import type {SanityDocument} from '../documents'
import type {Rule} from '../validation'

export {defineType, defineField, defineArrayMember, typed} from './define'

Expand Down
4 changes: 2 additions & 2 deletions packages/@sanity/vision/src/components/VisionGui.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,10 @@ import {type VisionProps} from '../types'
import {encodeQueryString} from '../util/encodeQueryString'
import {getLocalStorage, LocalStorageish} from '../util/localStorage'
import {parseApiQueryString, ParsedApiQueryString} from '../util/parseApiQueryString'
import {validateApiVersion} from '../util/validateApiVersion'
import {prefixApiVersion} from '../util/prefixApiVersion'
import {tryParseParams} from '../util/tryParseParams'
import {ResizeObserver} from '../util/resizeObserver'
import {tryParseParams} from '../util/tryParseParams'
import {validateApiVersion} from '../util/validateApiVersion'
import {DelayedSpinner} from './DelayedSpinner'
import {ParamsEditor, type ParamsEditorChangeEvent} from './ParamsEditor'
import {PerspectivePopover} from './PerspectivePopover'
Expand Down
22 changes: 11 additions & 11 deletions packages/sanity/src/_internal/cli/commands/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,34 +10,34 @@ import aliasDatasetCommand from './dataset/alias/aliasCommands'
import copyDatasetCommand from './dataset/copyDatasetCommand'
import createDatasetCommand from './dataset/createDatasetCommand'
import datasetGroup from './dataset/datasetGroup'
import listDatasetsCommand from './dataset/listDatasetsCommand'
import deployCommand from './deploy/deployCommand'
import undeployCommand from './deploy/undeployCommand'
import datasetVisibilityCommand from './dataset/datasetVisibilityCommand'
import deleteDatasetCommand from './dataset/deleteDatasetCommand'
import exportDatasetCommand from './dataset/exportDatasetCommand'
import importDatasetCommand from './dataset/importDatasetCommand'
import listDatasetsCommand from './dataset/listDatasetsCommand'
import deployCommand from './deploy/deployCommand'
import undeployCommand from './deploy/undeployCommand'
import devCommand from './dev/devCommand'
import createDocumentsCommand from './documents/createDocumentsCommand'
import deleteDocumentsCommand from './documents/deleteDocumentsCommand'
import documentsGroup from './documents/documentsGroup'
import getDocumentsCommand from './documents/getDocumentsCommand'
import queryDocumentsCommand from './documents/queryDocumentsCommand'
import validateDocumentsCommand from './documents/validateDocumentsCommand'
import execCommand from './exec/execCommand'
import deleteGraphQLAPICommand from './graphql/deleteGraphQLAPICommand'
import deployGraphQLAPICommand from './graphql/deployGraphQLAPICommand'
import graphqlGroup from './graphql/graphqlGroup'
import listGraphQLAPIsCommand from './graphql/listGraphQLAPIsCommand'
import createHookCommand from './hook/createHookCommand'
import deleteHookCommand from './hook/deleteHookCommand'
import hookGroup from './hook/hookGroup'
import listHookLogsCommand from './hook/listHookLogsCommand'
import listHooksCommand from './hook/listHooksCommand'
import printHookAttemptCommand from './hook/printHookAttemptCommand'
import previewCommand from './preview/previewCommand'
import startCommand from './start/startCommand'
import uninstallCommand from './uninstall/uninstallCommand'
import listHooksCommand from './hook/listHooksCommand'
import printHookAttemptCommand from './hook/printHookAttemptCommand'
import listHookLogsCommand from './hook/listHookLogsCommand'
import execCommand from './exec/execCommand'
import graphqlGroup from './graphql/graphqlGroup'
import listGraphQLAPIsCommand from './graphql/listGraphQLAPIsCommand'
import deployGraphQLAPICommand from './graphql/deployGraphQLAPICommand'
import deleteGraphQLAPICommand from './graphql/deleteGraphQLAPICommand'
import inviteUserCommand from './users/inviteUserCommand'
import listUsersCommand from './users/listUsersCommand'
import usersGroup from './users/usersGroup'
Expand Down
4 changes: 2 additions & 2 deletions packages/sanity/src/core/config/prepareConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ import {prepareI18n} from '../i18n/i18nConfig'
import {createSchema} from '../schema'
import {type AuthStore, createAuthStore, isAuthStore} from '../store/_legacy'
import {validateWorkspaces} from '../studio'
import {type InitialValueTemplateItem, type Template, type TemplateItem} from '../templates'
import {EMPTY_ARRAY, isNonNullable} from '../util'
import {filterDefinitions} from '../studio/components/navbar/search/definitions/defaultFilters'
import {operatorDefinitions} from '../studio/components/navbar/search/definitions/operators/defaultOperators'
import {type InitialValueTemplateItem, type Template, type TemplateItem} from '../templates'
import {EMPTY_ARRAY, isNonNullable} from '../util'
import {ConfigResolutionError} from './ConfigResolutionError'
import {SchemaError} from './SchemaError'
import {
Expand Down
44 changes: 22 additions & 22 deletions packages/sanity/src/core/config/types.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,26 @@
import {type BifurClient} from '@sanity/bifur-client'
import {type ClientConfig as SanityClientConfig, type SanityClient} from '@sanity/client'
import {
type AssetSource,
type CurrentUser,
type ObjectSchemaType,
type SanityDocumentLike,
type Schema,
type SchemaType,
type SchemaTypeDefinition,
} from '@sanity/types'
import {type i18n} from 'i18next'
import {type ComponentType, type ReactNode} from 'react'
import {type Observable} from 'rxjs'
import {type LocalePluginOptions, type LocaleSource} from '../i18n/types'
import {type InitialValueTemplateItem, type Template, type TemplateItem} from '../templates'
import {type AuthStore} from '../store'
import {type StudioTheme} from '../theme'
import {type SearchFilterDefinition} from '../studio/components/navbar/search/definitions/filters'
import {type SearchOperatorDefinition} from '../studio/components/navbar/search/definitions/operators'
import {type StudioComponents, type StudioComponentsPluginOptions} from './studio'
import {type AuthConfig} from './auth/types'
import {
import {type FormBuilderCustomMarkersComponent, type FormBuilderMarkersComponent} from '../form'
import {type LocalePluginOptions, type LocaleSource} from '../i18n/types'
import {type AuthStore} from '../store'
import {type SearchFilterDefinition} from '../studio/components/navbar/search/definitions/filters'
import {type SearchOperatorDefinition} from '../studio/components/navbar/search/definitions/operators'
import {type InitialValueTemplateItem, type Template, type TemplateItem} from '../templates'
import {type StudioTheme} from '../theme'
import {type AuthConfig} from './auth/types'
import {
type DocumentActionComponent,
type DocumentBadgeComponent,
type DocumentFieldAction,
Expand All @@ -17,19 +29,7 @@ import {
type DocumentInspector,
} from './document'
import {FormComponents} from './form'
import type {FormBuilderCustomMarkersComponent, FormBuilderMarkersComponent} from '../form'
import type {BifurClient} from '@sanity/bifur-client'
import type {ClientConfig as SanityClientConfig, SanityClient} from '@sanity/client'
import type {
AssetSource,
CurrentUser,
ObjectSchemaType,
SanityDocumentLike,
Schema,
SchemaType,
SchemaTypeDefinition,
} from '@sanity/types'
import type {i18n} from 'i18next'
import {type StudioComponents, type StudioComponentsPluginOptions} from './studio'
import {type Router, type RouterState} from 'sanity/router'

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {pathToString} from '../../../../field'
import {useTranslation} from '../../../../i18n'
import {EMPTY_ARRAY} from '../../../../util'
import {useChildPresence} from '../../../studio/contexts/Presence'
import {
import {
type BlockAnnotationProps,
type RenderAnnotationCallback,
type RenderArrayOfObjectsItemCallback,
Expand All @@ -23,8 +23,8 @@ import {debugRender} from '../debugRender'
import {useMemberValidation} from '../hooks/useMemberValidation'
import {usePortableTextMarkers} from '../hooks/usePortableTextMarkers'
import {usePortableTextMemberItem} from '../hooks/usePortableTextMembers'
import {AnnotationToolbarPopover} from './AnnotationToolbarPopover'
import {Root, TooltipBox} from './Annotation.styles'
import {AnnotationToolbarPopover} from './AnnotationToolbarPopover'
import {ObjectEditModal} from './modals/ObjectEditModal'

interface AnnotationProps {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ import React, {
useRef,
useState,
} from 'react'
import {useTranslation} from '../../../i18n'
import {MenuButton, MenuItem, TooltipDelayGroupProvider} from '../../../../ui-components'
import {ContextMenuButton} from '../../../components/contextMenuButton'
import {DocumentFieldActionNode} from '../../../config'
import {useTranslation} from '../../../i18n'
import {FormField} from '../../components'
import {usePublishedId} from '../../contexts/DocumentIdProvider'
import {FieldActionsProvider, FieldActionsResolver} from '../../field'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,12 @@ import {FieldPresence} from '../../../presence'
import {FormFieldSet, FormFieldValidationStatus} from '../../components/formField'
import {useDidUpdate} from '../../hooks/useDidUpdate'
import {useScrollIntoViewOnFocusWithin} from '../../hooks/useScrollIntoViewOnFocusWithin'
import {set, unset} from '../../patch'
import {type ObjectItem, type ObjectItemProps} from '../../types'
import {randomKey} from '../../utils/randomKey'
import {InsertMenu} from '../arrays/ArrayOfObjectsInput/InsertMenu'
import {createProtoArrayValue} from '../arrays/ArrayOfObjectsInput/createProtoArrayValue'
import {RowLayout} from '../arrays/layouts/RowLayout'
import {set, unset} from '../../patch'
import {PreviewReferenceValue} from './PreviewReferenceValue'
import {ReferenceFinalizeAlertStrip} from './ReferenceFinalizeAlertStrip'
import {ReferenceItemRefProvider} from './ReferenceItemRefProvider'
Expand All @@ -30,7 +31,6 @@ import {ReferenceMetadataLoadErrorAlertStrip} from './ReferenceMetadataLoadFailu
import {ReferenceStrengthMismatchAlertStrip} from './ReferenceStrengthMismatchAlertStrip'
import {useReferenceInfo} from './useReferenceInfo'
import {useReferenceInput} from './useReferenceInput'
import {type ObjectItem, type ObjectItemProps} from '../../types'
import {IntentLink} from 'sanity/router'

export interface ReferenceItemValue extends Omit<ObjectItem, '_type'>, Omit<Reference, '_key'> {}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ import {EditPortal} from '../../../../components/EditPortal'
import {useDidUpdate} from '../../../../hooks/useDidUpdate'
import {useScrollIntoViewOnFocusWithin} from '../../../../hooks/useScrollIntoViewOnFocusWithin'
import {useChildPresence} from '../../../../studio/contexts/Presence'
import {useChildValidation} from '../../../../studio/contexts/Validation'
import {ObjectItem, ObjectItemProps} from '../../../../types'
import {randomKey} from '../../../../utils/randomKey'
import {useChildValidation} from '../../../../studio/contexts/Validation'
import {CellLayout} from '../../layouts/CellLayout'
import {InsertMenu} from '../InsertMenu'
import {createProtoArrayValue} from '../createProtoArrayValue'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,13 @@ import {MemberField, MemberFieldError, MemberFieldSet} from '../../../members'
import {PatchEvent, setIfMissing, unset} from '../../../patch'
import {Uploader, UploaderResolver, UploadOptions} from '../../../studio/uploads/types'
import {InputProps, ObjectInputProps} from '../../../types'
import {WithReferencedAsset} from '../../../utils/WithReferencedAsset'
import {ActionsMenu} from '../common/ActionsMenu'
import {UploadProgress} from '../common/UploadProgress'
import {handleSelectAssetFromSource} from '../common/assetSource'
import {PlaceholderText} from '../common/PlaceholderText'
import {UploadPlaceholder} from '../common/UploadPlaceholder'
import {UploadProgress} from '../common/UploadProgress'
import {UploadWarning} from '../common/UploadWarning'
import {WithReferencedAsset} from '../../../utils/WithReferencedAsset'
import {handleSelectAssetFromSource} from '../common/assetSource'
import {FileInfo, FileTarget} from '../common/styles'
import {FileActionsMenu} from './FileActionsMenu'
import {FileSkeleton} from './FileSkeleton'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,10 @@ import {ImageToolInput} from '../ImageToolInput'
import {ActionsMenu} from '../common/ActionsMenu'
import {UploadPlaceholder} from '../common/UploadPlaceholder'
import {UploadProgress} from '../common/UploadProgress'
import {UploadWarning} from '../common/UploadWarning'
import {handleSelectAssetFromSource} from '../common/assetSource'
import {FileTarget} from '../common/styles'
import {ImageUrlBuilder} from '../types'
import {UploadWarning} from '../common/UploadWarning'
import {ImageActionsMenu} from './ImageActionsMenu'
import {ImagePreview} from './ImagePreview'
import {InvalidImageWarning} from './InvalidImageWarning'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import {applyAll} from '../../../patch/applyPatch'
import {ArrayOfObjectsFormNode, FieldMember} from '../../../store'
import {useDocumentFieldActions} from '../../../studio/contexts/DocumentFieldActions'
import {FormCallbacksProvider, useFormCallbacks} from '../../../studio/contexts/FormCallbacks'
import {resolveUploader as defaultResolveUploader} from '../../../studio/uploads/resolveUploader'
import {FileLike, UploadProgressEvent} from '../../../studio/uploads/types'
import {
ArrayFieldProps,
Expand All @@ -30,7 +31,6 @@ import {
} from '../../../types'
import {useFormBuilder} from '../../../useFormBuilder'
import {ensureKey} from '../../../utils/ensureKey'
import {resolveUploader as defaultResolveUploader} from '../../../studio/uploads/resolveUploader'
import * as is from '../../../utils/is'
import {createDescriptionId} from '../../common/createDescriptionId'
import {resolveInitialArrayValues} from '../../common/resolveInitialArrayValues'
Expand Down
Loading

0 comments on commit 8e49737

Please sign in to comment.