diff --git a/packages/create-payload-app/src/lib/create-project.spec.ts b/packages/create-payload-app/src/lib/create-project.spec.ts index 01dad6e8c..3f1c8fc79 100644 --- a/packages/create-payload-app/src/lib/create-project.spec.ts +++ b/packages/create-payload-app/src/lib/create-project.spec.ts @@ -14,7 +14,7 @@ import { getValidTemplates } from './templates.js' describe('createProject', () => { let projectDir: string beforeAll(() => { - jest.spyOn(console, 'log').mockImplementation() + console.log = jest.fn() }) beforeEach(() => { diff --git a/packages/eslint-config/configs/jest/rules/jest.mjs b/packages/eslint-config/configs/jest/rules/jest.mjs index 8599011bc..677e31678 100644 --- a/packages/eslint-config/configs/jest/rules/jest.mjs +++ b/packages/eslint-config/configs/jest/rules/jest.mjs @@ -22,7 +22,7 @@ export const index = { 'jest/prefer-called-with': 'error', 'jest/prefer-expect-assertions': 'off', 'jest/prefer-hooks-on-top': 'error', - 'jest/prefer-spy-on': 'error', + 'jest/prefer-spy-on': 'off', // broken in packages/create-payload-app/src/lib/create-project.spec.ts 'jest/prefer-strict-equal': 'warn', 'jest/prefer-to-contain': 'error', 'jest/prefer-to-have-length': 'error', diff --git a/packages/richtext-lexical/src/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/LexicalMenu.tsx b/packages/richtext-lexical/src/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/LexicalMenu.tsx index 450eb2fe9..c62ae0fe5 100644 --- a/packages/richtext-lexical/src/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/LexicalMenu.tsx +++ b/packages/richtext-lexical/src/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/LexicalMenu.tsx @@ -92,9 +92,7 @@ function $splitNodeContainingQuery(match: MenuTextMatch): TextNode | null { } const selectionOffset = anchor.offset const textContent = anchorNode.getTextContent().slice(0, selectionOffset) - // eslint-disable-next-line react/destructuring-assignment const characterOffset = match.replaceableString.length - // eslint-disable-next-line react/destructuring-assignment const queryOffset = getFullMatchOffset(textContent, match.matchingString, characterOffset) const startOffset = selectionOffset - queryOffset if (startOffset < 0) { diff --git a/packages/richtext-lexical/src/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/types.ts b/packages/richtext-lexical/src/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/types.ts index 483aa3425..105dd64fb 100644 --- a/packages/richtext-lexical/src/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/types.ts +++ b/packages/richtext-lexical/src/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/types.ts @@ -1,5 +1,5 @@ import type { I18nClient } from '@payloadcms/translations' -import type { LexicalEditor } from 'lexical' +import type { LexicalEditor, Spread } from 'lexical' import type { MutableRefObject } from 'react' import type React from 'react' @@ -37,6 +37,9 @@ export type SlashMenuItemInternal = { ref: MutableRefObject } & SlashMenuItem -export type SlashMenuGroupInternal = { - items: Array -} & SlashMenuGroup +export type SlashMenuGroupInternal = Spread< + { + items: Array + }, + SlashMenuGroup +>