Skip to content

Commit

Permalink
fix: run prettier
Browse files Browse the repository at this point in the history
  • Loading branch information
bjoerge authored and rexxars committed Feb 14, 2024
1 parent 5a215ca commit e24a458
Show file tree
Hide file tree
Showing 30 changed files with 89 additions and 86 deletions.
4 changes: 2 additions & 2 deletions dev/design-studio/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"extends": "../tsconfig.dev",
"include": ["**/*.ts", "**/*.tsx"],
"compilerOptions": {
"jsx": "preserve"
"jsx": "preserve",
},
"references": [{"path": "../../packages/sanity/tsconfig.lib.json"}]
"references": [{"path": "../../packages/sanity/tsconfig.lib.json"}],
}
4 changes: 2 additions & 2 deletions dev/embedded-studio/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
"resolveJsonModule": true,
"isolatedModules": true,
"jsx": "preserve",
"incremental": true
"incremental": true,
},
"include": ["**/*.ts", "**/*.tsx"],
"exclude": ["node_modules"]
"exclude": ["node_modules"],
}
4 changes: 2 additions & 2 deletions dev/starter-next-studio/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
"moduleResolution": "node",
"resolveJsonModule": true,
"isolatedModules": true,
"jsx": "preserve"
"jsx": "preserve",
},
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx"],
"exclude": ["node_modules"]
"exclude": ["node_modules"],
}
4 changes: 2 additions & 2 deletions dev/starter-studio/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"extends": "../tsconfig.dev",
"include": ["**/*.ts", "**/*.tsx"],
"compilerOptions": {
"jsx": "preserve"
"jsx": "preserve",
},
"references": [{"path": "../../packages/sanity/tsconfig.lib.json"}]
"references": [{"path": "../../packages/sanity/tsconfig.lib.json"}],
}
4 changes: 2 additions & 2 deletions dev/strict-studio/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"include": ["**/*.ts", "**/*.tsx"],
"compilerOptions": {
"composite": true,
"jsx": "preserve"
"jsx": "preserve",
},
"references": [{"path": "../../packages/sanity/tsconfig.lib.json"}]
"references": [{"path": "../../packages/sanity/tsconfig.lib.json"}],
}
4 changes: 2 additions & 2 deletions dev/studio-e2e-testing/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
"resolveJsonModule": true,
"isolatedModules": true,
"jsx": "react-jsx",
"incremental": true
"incremental": true,
},
"include": ["**/*.ts", "**/*.tsx"],
"exclude": ["node_modules"]
"exclude": ["node_modules"],
}
8 changes: 4 additions & 4 deletions dev/test-next-studio/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@
"jsx": "preserve",
"plugins": [
{
"name": "next"
}
"name": "next",
},
],
"strictNullChecks": true
"strictNullChecks": true,
},
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"],
"exclude": ["node_modules"]
"exclude": ["node_modules"],
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ export interface LanguageFilterMenuButtonProps {

export function LanguageFilterMenuButton(props: LanguageFilterMenuButtonProps) {
const {options} = props
const defaultLanguages = options.supportedLanguages.filter(
(l) => options.defaultLanguages?.includes(l.id),
const defaultLanguages = options.supportedLanguages.filter((l) =>
options.defaultLanguages?.includes(l.id),
)
const languageOptions = options.supportedLanguages.filter(
(l) => !options.defaultLanguages?.includes(l.id),
Expand Down
6 changes: 3 additions & 3 deletions dev/test-studio/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@
"compilerOptions": {
"jsx": "react-jsx",
"allowJs": true,
"isolatedModules": false
"isolatedModules": false,
},
"references": [
{"path": "../../packages/@sanity/types/tsconfig.lib.json"},
{"path": "../../packages/@sanity/vision/tsconfig.lib.json"},
{"path": "../../packages/sanity/tsconfig.lib.json"},
{"path": "../../packages/@sanity/migrate/tsconfig.lib.json"}
]
{"path": "../../packages/@sanity/migrate/tsconfig.lib.json"},
],
}
4 changes: 2 additions & 2 deletions packages/@sanity/block-tools/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"rootDir": ".",
"outDir": "./lib/dts",

"jsx": "react-jsx"
"jsx": "react-jsx",
},
"references": [{"path": "../schema/tsconfig.lib.json"}, {"path": "../types/tsconfig.lib.json"}]
"references": [{"path": "../schema/tsconfig.lib.json"}, {"path": "../types/tsconfig.lib.json"}],
}
13 changes: 6 additions & 7 deletions packages/@sanity/cli/src/workers/getCliConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,10 @@ import {getCliConfig} from '../util/getCliConfig'
// We're communicating with a parent process through a message channel
getCliConfig(workerData, {forked: false})
.then((config) => parentPort?.postMessage({type: 'config', config}))
.catch(
(error) =>
parentPort?.postMessage({
type: 'error',
error: error instanceof Error ? error.stack : error,
errorType: error && (error.type || error.name),
}),
.catch((error) =>
parentPort?.postMessage({
type: 'error',
error: error instanceof Error ? error.stack : error,
errorType: error && (error.type || error.name),
}),
)
4 changes: 2 additions & 2 deletions packages/@sanity/cli/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"checkJs": false,
"allowJs": true,
"jsx": "react-jsx",
"resolveJsonModule": true
"resolveJsonModule": true,
},
"references": [{"path": "../types/tsconfig.lib.json"}, {"path": "../util/tsconfig.lib.json"}]
"references": [{"path": "../types/tsconfig.lib.json"}, {"path": "../util/tsconfig.lib.json"}],
}
4 changes: 2 additions & 2 deletions packages/@sanity/diff/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@
"jsx": "react-jsx",

// todo: we need to disable noImplicitAny in a transition phase and should be removed eventually
"noImplicitAny": false
}
"noImplicitAny": false,
},
}
4 changes: 2 additions & 2 deletions packages/@sanity/migrate/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"composite": true,
"rootDir": ".",
"outDir": "./lib/dts",
"declarationDir": "./lib/dts"
"declarationDir": "./lib/dts",
},
"references": [{"path": "../@sanity/types/tsconfig.lib.json"}]
"references": [{"path": "../@sanity/types/tsconfig.lib.json"}],
}
4 changes: 2 additions & 2 deletions packages/@sanity/mutator/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@
"composite": true,
"declarationDir": "./lib/dts",
"rootDir": ".",
"outDir": "./lib/dts"
}
"outDir": "./lib/dts",
},
}
8 changes: 4 additions & 4 deletions packages/@sanity/portable-text-editor/e2e-tests/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
"ts-node": {
// these options are overrides used only by ts-node
"compilerOptions": {
"module": "commonjs"
}
"module": "commonjs",
},
},
"compilerOptions": {
"target": "ESNext"
}
"target": "ESNext",
},
}
6 changes: 3 additions & 3 deletions packages/@sanity/portable-text-editor/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@
"outDir": "./lib/dts",

"jsx": "react-jsx",
"isolatedModules": false
"isolatedModules": false,
},
"references": [
{"path": "../block-tools/tsconfig.lib.json"},
{"path": "../schema/tsconfig.lib.json"},
{"path": "../types/tsconfig.lib.json"},
{"path": "../util/tsconfig.lib.json"}
]
{"path": "../util/tsconfig.lib.json"},
],
}
4 changes: 2 additions & 2 deletions packages/@sanity/schema/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"outDir": "./lib/dts",

"noUnusedLocals": false,
"strict": false
"strict": false,
},
"references": [{"path": "../types/tsconfig.lib.json"}]
"references": [{"path": "../types/tsconfig.lib.json"}],
}
20 changes: 11 additions & 9 deletions packages/@sanity/types/src/schema/defineTypes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,23 +75,25 @@ export type MaybeAllowUnknownProps<TStrict extends StrictDefinition> = TStrict e
export type MaybePreview<
Select extends Record<string, string> | undefined,
PrepareValue extends Record<keyof Select, any> | undefined,
> = Select extends Record<string, string>
? PrepareValue extends Record<keyof Select, any>
? PreviewConfig<Select, PrepareValue>
> =
Select extends Record<string, string>
? PrepareValue extends Record<keyof Select, any>
? PreviewConfig<Select, PrepareValue>
: never
: never
: never

/** @beta */
export type NarrowPreview<
TType extends string,
TAlias extends IntrinsicTypeName | undefined,
TSelect extends Record<string, string> | undefined,
TPrepareValue extends Record<keyof TSelect, any> | undefined,
> = DefineSchemaType<TType, TAlias> extends {preview?: Record<string, any>}
? {
preview?: MaybePreview<TSelect, TPrepareValue>
}
: unknown
> =
DefineSchemaType<TType, TAlias> extends {preview?: Record<string, any>}
? {
preview?: MaybePreview<TSelect, TPrepareValue>
}
: unknown

/** @beta */
// Must type-widen some fields on the way out of the define functions to be compatible with FieldDefinition and ArrayDefinition
Expand Down
6 changes: 3 additions & 3 deletions packages/@sanity/types/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

"jsx": "react-jsx",
"paths": {
"_self_": ["./src"]
}
}
"_self_": ["./src"],
},
},
}
2 changes: 1 addition & 1 deletion packages/@sanity/util/test/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"include": ["../src", "."]
"include": ["../src", "."],
}
4 changes: 2 additions & 2 deletions packages/@sanity/util/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"compilerOptions": {
"composite": true,
"rootDir": ".",
"outDir": "./lib"
"outDir": "./lib",
},
"references": [{"path": "../types/tsconfig.lib.json"}]
"references": [{"path": "../types/tsconfig.lib.json"}],
}
7 changes: 5 additions & 2 deletions packages/@sanity/vision/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,10 @@
"rootDir": ".",
"outDir": "./lib/dts",

"jsx": "react-jsx"
"jsx": "react-jsx",
},
"references": [{"path": "../types/tsconfig.lib.json"}, {"path": "../../sanity/tsconfig.lib.json"}]
"references": [
{"path": "../types/tsconfig.lib.json"},
{"path": "../../sanity/tsconfig.lib.json"},
],
}
4 changes: 2 additions & 2 deletions packages/groq/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@
"compilerOptions": {
"composite": true,
"rootDir": ".",
"outDir": "./lib/dts"
}
"outDir": "./lib/dts",
},
}
Original file line number Diff line number Diff line change
Expand Up @@ -107,12 +107,11 @@ function createPlainTextUploader(itemTypes: PrimitiveSchemaType[]): Uploader<Pri
type: 'string',
upload(client, file) {
return readAsText(file, 'utf-8').pipe(
map(
(textContent) =>
textContent
?.split(/[\n\r]/)
.map((value) => convertToSchemaType(value, itemTypes))
.filter((v) => v !== undefined),
map((textContent) =>
textContent
?.split(/[\n\r]/)
.map((value) => convertToSchemaType(value, itemTypes))
.filter((v) => v !== undefined),
),
filter((v: unknown[] | undefined): v is unknown[] => Array.isArray(v)),
map((lines: unknown[]) => ({
Expand Down
10 changes: 5 additions & 5 deletions packages/sanity/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"./scripts",
"./src",
"./test",
"./typings"
"./typings",
],
"compilerOptions": {
"composite": true,
Expand All @@ -21,7 +21,7 @@
"sanity/desk": ["./exports/desk.ts"],
"sanity/router": ["./exports/router.ts"],
"sanity/structure": ["./exports/structure.ts"],
"sanity": ["./exports/index.ts"]
"sanity": ["./exports/index.ts"],
},

"emitDeclarationOnly": true,
Expand All @@ -31,7 +31,7 @@
"resolveJsonModule": true,

// For import.meta.env/import.meta.hot definition and similar
"types": ["vite/client"]
"types": ["vite/client"],
},
"references": [
{"path": "../@sanity/cli/tsconfig.lib.json"},
Expand All @@ -42,6 +42,6 @@
{"path": "../@sanity/types/tsconfig.lib.json"},
{"path": "../@sanity/cli/tsconfig.lib.json"},
{"path": "../@sanity/util/tsconfig.lib.json"},
{"path": "../@sanity/migrate/tsconfig.lib.json"}
]
{"path": "../@sanity/migrate/tsconfig.lib.json"},
],
}
4 changes: 2 additions & 2 deletions perf/studio/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
"extends": "../../tsconfig.settings.json",
"compilerOptions": {
"jsx": "react-jsx",
"esModuleInterop": true
}
"esModuleInterop": true,
},
}
4 changes: 2 additions & 2 deletions perf/tests/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@
"esModuleInterop": true,
"module": "CommonJS",
"noEmit": true,
"resolveJsonModule": true
}
"resolveJsonModule": true,
},
}
4 changes: 2 additions & 2 deletions scripts/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
"include": ["./**/*.ts", "./**/*.tsx", "./**/*.js", "./**/*.jsx", "./**/*.json"],
"extends": "../tsconfig.settings.json",
"compilerOptions": {
"resolveJsonModule": true
}
"resolveJsonModule": true,
},
}
6 changes: 3 additions & 3 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"compilerOptions": {
"emitDeclarationOnly": true,
"outDir": "./node_modules/.sanity-monorepo/dts",
"allowJs": true
"allowJs": true,
},
"references": [
{"path": "./packages/@sanity/block-tools"},
Expand All @@ -16,6 +16,6 @@
{"path": "./packages/@sanity/types"},
{"path": "./packages/@sanity/util"},
{"path": "./packages/@sanity/vision"},
{"path": "./packages/sanity"}
]
{"path": "./packages/sanity"},
],
}

0 comments on commit e24a458

Please sign in to comment.