diff --git a/packages/app/package.json b/packages/app/package.json index 3edc1ec7..ffa3daf5 100644 --- a/packages/app/package.json +++ b/packages/app/package.json @@ -85,7 +85,7 @@ "npm-run-all": "4.1.5", "postcss": "8.4.21", "postcss-scss": "4.0.6", - "prettier": "2.8.1", + "prettier": "2.8.2", "source-map-loader": "4.0.1", "style-loader": "3.3.1", "to-string-loader": "1.2.0", diff --git a/packages/core/package.json b/packages/core/package.json index c9d87276..163caf37 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -243,7 +243,7 @@ "npm-run-all": "4.1.5", "postcss": "8.4.21", "postcss-scss": "4.0.6", - "prettier": "2.8.1", + "prettier": "2.8.2", "process": "0.11.10", "react-refresh": "0.14.0", "react-svg-loader": "3.0.3", diff --git a/packages/core/src/formats/frontmatter.ts b/packages/core/src/formats/frontmatter.ts index 4b3af81b..a8a76248 100644 --- a/packages/core/src/formats/frontmatter.ts +++ b/packages/core/src/formats/frontmatter.ts @@ -11,7 +11,7 @@ const Languages = { JSON: 'json', } as const; -type Language = typeof Languages[keyof typeof Languages]; +type Language = (typeof Languages)[keyof typeof Languages]; export type Delimiter = string | [string, string]; type Format = { language: Language; delimiters: Delimiter }; diff --git a/packages/core/src/lib/registry.ts b/packages/core/src/lib/registry.ts index 1eb975e0..ae46ad90 100644 --- a/packages/core/src/lib/registry.ts +++ b/packages/core/src/lib/registry.ts @@ -28,7 +28,7 @@ import type { } from '../interface'; export const allowedEvents = ['prePublish', 'postPublish', 'preSave', 'postSave'] as const; -export type AllowedEvent = typeof allowedEvents[number]; +export type AllowedEvent = (typeof allowedEvents)[number]; const eventHandlers = allowedEvents.reduce((acc, e) => { acc[e] = []; diff --git a/packages/core/src/lib/util/backendUtil.ts b/packages/core/src/lib/util/backendUtil.ts index 0d747937..04ecb3b6 100644 --- a/packages/core/src/lib/util/backendUtil.ts +++ b/packages/core/src/lib/util/backendUtil.ts @@ -24,11 +24,11 @@ const formatters = { function catchFormatErrors( format: T, - formatter: typeof formatters[T], + formatter: (typeof formatters)[T], ) { return (res: Response) => { try { - return formatter(res) as ReturnType; + return formatter(res) as ReturnType<(typeof formatters)[T]>; } catch (error: unknown) { if (error instanceof Error) { throw new Error( @@ -62,8 +62,8 @@ interface ParseResponseOptions { export async function parseResponse( res: Response, { expectingOk = true, format = 'text', apiName = '' }: ParseResponseOptions, -): Promise>> { - let body: Awaited>; +): Promise>> { + let body: Awaited>; try { const formatter = responseFormatters[format] ?? false; if (!formatter) { diff --git a/packages/core/src/widgets/markdown/plate/serialization/slate/ast-types.ts b/packages/core/src/widgets/markdown/plate/serialization/slate/ast-types.ts index c378257a..9b130c99 100644 --- a/packages/core/src/widgets/markdown/plate/serialization/slate/ast-types.ts +++ b/packages/core/src/widgets/markdown/plate/serialization/slate/ast-types.ts @@ -178,90 +178,90 @@ export interface TextNodeStyles { export type TextNode = { text?: string | undefined } & TextNodeStyles; export type CodeBlockNode = { - type: typeof NodeTypes['code_block']; + type: (typeof NodeTypes)['code_block']; lang: string | undefined; code: string; }; export type HeadingNode = { type: - | typeof NodeTypes['heading'][1] - | typeof NodeTypes['heading'][2] - | typeof NodeTypes['heading'][3] - | typeof NodeTypes['heading'][4] - | typeof NodeTypes['heading'][5] - | typeof NodeTypes['heading'][6]; + | (typeof NodeTypes)['heading'][1] + | (typeof NodeTypes)['heading'][2] + | (typeof NodeTypes)['heading'][3] + | (typeof NodeTypes)['heading'][4] + | (typeof NodeTypes)['heading'][5] + | (typeof NodeTypes)['heading'][6]; children: Array; }; export type ListNode = { - type: typeof NodeTypes['ol_list'] | typeof NodeTypes['ul_list']; + type: (typeof NodeTypes)['ol_list'] | (typeof NodeTypes)['ul_list']; children: Array; }; export type ListItemNode = { - type: typeof NodeTypes['listItem']; + type: (typeof NodeTypes)['listItem']; checked: boolean; children: Array; }; export type ListItemContentNode = { - type: typeof NodeTypes['listItemContent']; + type: (typeof NodeTypes)['listItemContent']; children: Array; }; export type ParagraphNode = { - type: typeof NodeTypes['paragraph']; + type: (typeof NodeTypes)['paragraph']; break?: true; children: Array; }; export type LinkNode = { - type: typeof NodeTypes['link']; + type: (typeof NodeTypes)['link']; children: Array; url: string | undefined; }; export type ImageNode = { - type: typeof NodeTypes['image']; + type: (typeof NodeTypes)['image']; children: Array; url: string | undefined; alt: string | undefined; }; export type TableNode = { - type: typeof NodeTypes['table']; + type: (typeof NodeTypes)['table']; children: Array; }; export type TableRowNode = { - type: typeof NodeTypes['tableRow']; + type: (typeof NodeTypes)['tableRow']; children: Array; }; export type TableCellNode = { - type: typeof NodeTypes['tableCell']; + type: (typeof NodeTypes)['tableCell']; children: Array; }; export type BlockQuoteNode = { - type: typeof NodeTypes['block_quote']; + type: (typeof NodeTypes)['block_quote']; children: Array; }; export type InlineCodeMarkNode = { - type: typeof NodeTypes['inline_code_mark']; + type: (typeof NodeTypes)['inline_code_mark']; children: Array; language: string | undefined; }; export type ThematicBreakNode = { - type: typeof NodeTypes['thematic_break']; + type: (typeof NodeTypes)['thematic_break']; children: Array; }; export type ItalicNode = { - [K in typeof NodeTypes['emphasis_mark']]: true; + [K in (typeof NodeTypes)['emphasis_mark']]: true; } & { children: TextNode; }; @@ -275,19 +275,19 @@ export type MarkNode = | InlineCodeNode; export type SuperscriptNode = { - [K in typeof NodeTypes['superscript_mark']]: true; + [K in (typeof NodeTypes)['superscript_mark']]: true; } & { children: TextNode; }; export type SubscriptNode = { - [K in typeof NodeTypes['subscript_mark']]: true; + [K in (typeof NodeTypes)['subscript_mark']]: true; } & { children: TextNode; }; export type UnderlineNode = { - [K in typeof NodeTypes['underline_mark']]: true; + [K in (typeof NodeTypes)['underline_mark']]: true; } & { children: TextNode; }; diff --git a/packages/docs/package.json b/packages/docs/package.json index edd37a4e..eb56bfc4 100644 --- a/packages/docs/package.json +++ b/packages/docs/package.json @@ -52,7 +52,7 @@ "eslint-plugin-babel": "5.3.1", "eslint-plugin-unicorn": "45.0.2", "npm-run-all": "4.1.5", - "prettier": "2.8.1", + "prettier": "2.8.2", "typescript": "4.9.4", "webpack": "5.75.0" }, diff --git a/yarn.lock b/yarn.lock index 9e5a2940..1a97af3c 100644 --- a/yarn.lock +++ b/yarn.lock @@ -12946,10 +12946,10 @@ prettier-linter-helpers@^1.0.0: dependencies: fast-diff "^1.1.2" -prettier@2.8.1: - version "2.8.1" - resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.8.1.tgz#4e1fd11c34e2421bc1da9aea9bd8127cd0a35efc" - integrity sha512-lqGoSJBQNJidqCHE80vqZJHWHRFoNYsSpP9AjFhlhi9ODCJA541svILes/+/1GM3VaL/abZi7cpFzOpdR9UPKg== +prettier@2.8.2: + version "2.8.2" + resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.8.2.tgz#c4ea1b5b454d7c4b59966db2e06ed7eec5dfd160" + integrity sha512-BtRV9BcncDyI2tsuS19zzhzoxD8Dh8LiCx7j7tHzrkz8GFXAexeWFdi22mjE1d16dftH2qNaytVxqiRTGlMfpw== pretty-bytes@^5.3.0, pretty-bytes@^5.4.1: version "5.6.0"