From d55b6a3db95edd78c230a82553484df437435151 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Germ=C3=A1n=20Jablo=C3=B1ski?= <43938777+GermanJablo@users.noreply.github.com> Date: Wed, 15 Jan 2025 07:06:40 -0300 Subject: [PATCH] chore: enable noImplicitOverride in all packages (#10588) --- packages/create-payload-app/tsconfig.json | 1 - packages/db-mongodb/tsconfig.json | 1 - packages/db-postgres/tsconfig.json | 1 - packages/db-sqlite/tsconfig.json | 1 - packages/db-vercel-postgres/tsconfig.json | 1 - packages/drizzle/tsconfig.json | 1 - packages/graphql/tsconfig.json | 1 - packages/live-preview-react/tsconfig.json | 1 - packages/live-preview-vue/tsconfig.json | 1 - packages/live-preview/tsconfig.json | 1 - packages/next/tsconfig.json | 1 - packages/payload/tsconfig.json | 1 - packages/plugin-cloud-storage/tsconfig.json | 1 - packages/plugin-form-builder/tsconfig.json | 1 - packages/plugin-nested-docs/tsconfig.json | 1 - packages/plugin-redirects/tsconfig.json | 1 - packages/plugin-search/tsconfig.json | 1 - packages/plugin-seo/tsconfig.json | 1 - packages/plugin-stripe/tsconfig.json | 1 - .../blocks/client/nodes/BlocksNode.tsx | 10 +++---- .../blocks/client/nodes/InlineBlocksNode.tsx | 10 +++---- .../blocks/server/nodes/BlocksNode.tsx | 16 +++++----- .../blocks/server/nodes/InlineBlocksNode.tsx | 22 +++++++------- .../client/nodes/HorizontalRuleNode.tsx | 10 +++---- .../server/nodes/HorizontalRuleNode.tsx | 24 ++++++++------- .../src/features/link/nodes/AutoLinkNode.ts | 10 +++---- .../src/features/link/nodes/LinkNode.ts | 29 ++++++++++--------- .../nodes/unknownConvertedNode/index.tsx | 16 +++++----- .../nodes/unknownConvertedNode/index.tsx | 16 +++++----- .../client/nodes/RelationshipNode.tsx | 12 ++++---- .../server/nodes/RelationshipNode.tsx | 16 +++++----- .../upload/client/nodes/UploadNode.tsx | 12 ++++---- .../upload/server/nodes/UploadNode.tsx | 16 +++++----- packages/richtext-lexical/tsconfig.json | 3 +- packages/richtext-slate/tsconfig.json | 1 - packages/storage-azure/tsconfig.json | 1 - packages/storage-uploadthing/tsconfig.json | 1 - packages/translations/tsconfig.json | 1 - packages/ui/tsconfig.json | 1 - 39 files changed, 113 insertions(+), 133 deletions(-) diff --git a/packages/create-payload-app/tsconfig.json b/packages/create-payload-app/tsconfig.json index c9d8c5e06..cc47ae030 100644 --- a/packages/create-payload-app/tsconfig.json +++ b/packages/create-payload-app/tsconfig.json @@ -3,6 +3,5 @@ "compilerOptions": { /* TODO: remove the following lines */ "noUncheckedIndexedAccess": false, - "noImplicitOverride": false, }, } diff --git a/packages/db-mongodb/tsconfig.json b/packages/db-mongodb/tsconfig.json index 680d5fb20..ce82aadf9 100644 --- a/packages/db-mongodb/tsconfig.json +++ b/packages/db-mongodb/tsconfig.json @@ -4,7 +4,6 @@ /* TODO: remove the following lines */ "strict": false, "noUncheckedIndexedAccess": false, - "noImplicitOverride": false, }, "references": [{ "path": "../payload" }, { "path": "../translations" }] } diff --git a/packages/db-postgres/tsconfig.json b/packages/db-postgres/tsconfig.json index 513cf23b5..9aa0b2275 100644 --- a/packages/db-postgres/tsconfig.json +++ b/packages/db-postgres/tsconfig.json @@ -4,7 +4,6 @@ /* TODO: remove the following lines */ "strict": false, "noUncheckedIndexedAccess": false, - "noImplicitOverride": false, }, "references": [ { diff --git a/packages/db-sqlite/tsconfig.json b/packages/db-sqlite/tsconfig.json index 513cf23b5..9aa0b2275 100644 --- a/packages/db-sqlite/tsconfig.json +++ b/packages/db-sqlite/tsconfig.json @@ -4,7 +4,6 @@ /* TODO: remove the following lines */ "strict": false, "noUncheckedIndexedAccess": false, - "noImplicitOverride": false, }, "references": [ { diff --git a/packages/db-vercel-postgres/tsconfig.json b/packages/db-vercel-postgres/tsconfig.json index 513cf23b5..9aa0b2275 100644 --- a/packages/db-vercel-postgres/tsconfig.json +++ b/packages/db-vercel-postgres/tsconfig.json @@ -4,7 +4,6 @@ /* TODO: remove the following lines */ "strict": false, "noUncheckedIndexedAccess": false, - "noImplicitOverride": false, }, "references": [ { diff --git a/packages/drizzle/tsconfig.json b/packages/drizzle/tsconfig.json index 680d5fb20..ce82aadf9 100644 --- a/packages/drizzle/tsconfig.json +++ b/packages/drizzle/tsconfig.json @@ -4,7 +4,6 @@ /* TODO: remove the following lines */ "strict": false, "noUncheckedIndexedAccess": false, - "noImplicitOverride": false, }, "references": [{ "path": "../payload" }, { "path": "../translations" }] } diff --git a/packages/graphql/tsconfig.json b/packages/graphql/tsconfig.json index 2df4c5635..14564e071 100644 --- a/packages/graphql/tsconfig.json +++ b/packages/graphql/tsconfig.json @@ -4,7 +4,6 @@ /* TODO: remove the following lines */ "strict": false, "noUncheckedIndexedAccess": false, - "noImplicitOverride": false, }, "references": [{ "path": "../payload" }] } diff --git a/packages/live-preview-react/tsconfig.json b/packages/live-preview-react/tsconfig.json index 2df4c5635..14564e071 100644 --- a/packages/live-preview-react/tsconfig.json +++ b/packages/live-preview-react/tsconfig.json @@ -4,7 +4,6 @@ /* TODO: remove the following lines */ "strict": false, "noUncheckedIndexedAccess": false, - "noImplicitOverride": false, }, "references": [{ "path": "../payload" }] } diff --git a/packages/live-preview-vue/tsconfig.json b/packages/live-preview-vue/tsconfig.json index 595b81bdb..f041cbcc9 100644 --- a/packages/live-preview-vue/tsconfig.json +++ b/packages/live-preview-vue/tsconfig.json @@ -4,7 +4,6 @@ /* TODO: remove the following lines */ "strict": false, "noUncheckedIndexedAccess": false, - "noImplicitOverride": false, }, "references": [{ "path": "../payload" }] // db-mongodb depends on payload } diff --git a/packages/live-preview/tsconfig.json b/packages/live-preview/tsconfig.json index 2df4c5635..14564e071 100644 --- a/packages/live-preview/tsconfig.json +++ b/packages/live-preview/tsconfig.json @@ -4,7 +4,6 @@ /* TODO: remove the following lines */ "strict": false, "noUncheckedIndexedAccess": false, - "noImplicitOverride": false, }, "references": [{ "path": "../payload" }] } diff --git a/packages/next/tsconfig.json b/packages/next/tsconfig.json index 5f7685d4e..23192492c 100644 --- a/packages/next/tsconfig.json +++ b/packages/next/tsconfig.json @@ -4,7 +4,6 @@ /* TODO: remove the following lines */ "strict": false, "noUncheckedIndexedAccess": false, - "noImplicitOverride": false, }, "references": [ { "path": "../payload" }, diff --git a/packages/payload/tsconfig.json b/packages/payload/tsconfig.json index 3553827af..1e18fb6d2 100644 --- a/packages/payload/tsconfig.json +++ b/packages/payload/tsconfig.json @@ -4,7 +4,6 @@ /* TODO: remove the following lines */ "strict": false, "noUncheckedIndexedAccess": false, - "noImplicitOverride": false, }, "references": [{ "path": "../translations" }] } diff --git a/packages/plugin-cloud-storage/tsconfig.json b/packages/plugin-cloud-storage/tsconfig.json index 2df4c5635..14564e071 100644 --- a/packages/plugin-cloud-storage/tsconfig.json +++ b/packages/plugin-cloud-storage/tsconfig.json @@ -4,7 +4,6 @@ /* TODO: remove the following lines */ "strict": false, "noUncheckedIndexedAccess": false, - "noImplicitOverride": false, }, "references": [{ "path": "../payload" }] } diff --git a/packages/plugin-form-builder/tsconfig.json b/packages/plugin-form-builder/tsconfig.json index 45b2f18fb..6c57b9f88 100644 --- a/packages/plugin-form-builder/tsconfig.json +++ b/packages/plugin-form-builder/tsconfig.json @@ -4,7 +4,6 @@ /* TODO: remove the following lines */ "strict": false, "noUncheckedIndexedAccess": false, - "noImplicitOverride": false, }, "references": [{ "path": "../payload" }, { "path": "../ui" }] } diff --git a/packages/plugin-nested-docs/tsconfig.json b/packages/plugin-nested-docs/tsconfig.json index 2df4c5635..14564e071 100644 --- a/packages/plugin-nested-docs/tsconfig.json +++ b/packages/plugin-nested-docs/tsconfig.json @@ -4,7 +4,6 @@ /* TODO: remove the following lines */ "strict": false, "noUncheckedIndexedAccess": false, - "noImplicitOverride": false, }, "references": [{ "path": "../payload" }] } diff --git a/packages/plugin-redirects/tsconfig.json b/packages/plugin-redirects/tsconfig.json index 2df4c5635..14564e071 100644 --- a/packages/plugin-redirects/tsconfig.json +++ b/packages/plugin-redirects/tsconfig.json @@ -4,7 +4,6 @@ /* TODO: remove the following lines */ "strict": false, "noUncheckedIndexedAccess": false, - "noImplicitOverride": false, }, "references": [{ "path": "../payload" }] } diff --git a/packages/plugin-search/tsconfig.json b/packages/plugin-search/tsconfig.json index 868922448..4f8775677 100644 --- a/packages/plugin-search/tsconfig.json +++ b/packages/plugin-search/tsconfig.json @@ -4,7 +4,6 @@ /* TODO: remove the following lines */ "strict": false, "noUncheckedIndexedAccess": false, - "noImplicitOverride": false, }, "references": [{ "path": "../payload" }, { "path": "../ui" }, { "path": "../next" }] } diff --git a/packages/plugin-seo/tsconfig.json b/packages/plugin-seo/tsconfig.json index 868922448..4f8775677 100644 --- a/packages/plugin-seo/tsconfig.json +++ b/packages/plugin-seo/tsconfig.json @@ -4,7 +4,6 @@ /* TODO: remove the following lines */ "strict": false, "noUncheckedIndexedAccess": false, - "noImplicitOverride": false, }, "references": [{ "path": "../payload" }, { "path": "../ui" }, { "path": "../next" }] } diff --git a/packages/plugin-stripe/tsconfig.json b/packages/plugin-stripe/tsconfig.json index 868922448..4f8775677 100644 --- a/packages/plugin-stripe/tsconfig.json +++ b/packages/plugin-stripe/tsconfig.json @@ -4,7 +4,6 @@ /* TODO: remove the following lines */ "strict": false, "noUncheckedIndexedAccess": false, - "noImplicitOverride": false, }, "references": [{ "path": "../payload" }, { "path": "../ui" }, { "path": "../next" }] } diff --git a/packages/richtext-lexical/src/features/blocks/client/nodes/BlocksNode.tsx b/packages/richtext-lexical/src/features/blocks/client/nodes/BlocksNode.tsx index 5b39d013d..3cb2abc1e 100644 --- a/packages/richtext-lexical/src/features/blocks/client/nodes/BlocksNode.tsx +++ b/packages/richtext-lexical/src/features/blocks/client/nodes/BlocksNode.tsx @@ -10,15 +10,15 @@ import { ServerBlockNode } from '../../server/nodes/BlocksNode.js' import { BlockComponent } from '../component/index.js' export class BlockNode extends ServerBlockNode { - static clone(node: ServerBlockNode): ServerBlockNode { + static override clone(node: ServerBlockNode): ServerBlockNode { return super.clone(node) } - static getType(): string { + static override getType(): string { return super.getType() } - static importJSON(serializedNode: SerializedBlockNode): BlockNode { + static override importJSON(serializedNode: SerializedBlockNode): BlockNode { if (serializedNode.version === 1) { // Convert (version 1 had the fields wrapped in another, unnecessary data property) serializedNode = { @@ -34,7 +34,7 @@ export class BlockNode extends ServerBlockNode { return node } - decorate(editor: LexicalEditor, config: EditorConfig): JSX.Element { + override decorate(editor: LexicalEditor, config: EditorConfig): JSX.Element { return ( ) export class InlineBlockNode extends ServerInlineBlockNode { - static clone(node: ServerInlineBlockNode): ServerInlineBlockNode { + static override clone(node: ServerInlineBlockNode): ServerInlineBlockNode { return super.clone(node) } - static getType(): string { + static override getType(): string { return super.getType() } - static importJSON(serializedNode: SerializedInlineBlockNode): InlineBlockNode { + static override importJSON(serializedNode: SerializedInlineBlockNode): InlineBlockNode { const node = $createInlineBlockNode(serializedNode.fields) return node } - decorate(editor: LexicalEditor, config: EditorConfig): JSX.Element { + override decorate(editor: LexicalEditor, config: EditorConfig): JSX.Element { return ( | null { + static override importDOM(): DOMConversionMap | null { return {} } - static importJSON(serializedNode: SerializedBlockNode): ServerBlockNode { + static override importJSON(serializedNode: SerializedBlockNode): ServerBlockNode { if (serializedNode.version === 1) { // Convert (version 1 had the fields wrapped in another, unnecessary data property) serializedNode = { @@ -95,11 +95,11 @@ export class ServerBlockNode extends DecoratorBlockNode { return false } - decorate(editor: LexicalEditor, config: EditorConfig): JSX.Element | null { + override decorate(editor: LexicalEditor, config: EditorConfig): JSX.Element | null { return null } - exportDOM(): DOMExportOutput { + override exportDOM(): DOMExportOutput { const element = document.createElement('div') const text = document.createTextNode(this.getTextContent()) @@ -107,7 +107,7 @@ export class ServerBlockNode extends DecoratorBlockNode { return { element } } - exportJSON(): SerializedBlockNode { + override exportJSON(): SerializedBlockNode { return { ...super.exportJSON(), type: 'block', @@ -124,7 +124,7 @@ export class ServerBlockNode extends DecoratorBlockNode { return this.getLatest().__fields } - getTextContent(): string { + override getTextContent(): string { return `Block Field` } diff --git a/packages/richtext-lexical/src/features/blocks/server/nodes/InlineBlocksNode.tsx b/packages/richtext-lexical/src/features/blocks/server/nodes/InlineBlocksNode.tsx index 97cfe415b..4f8d861c4 100644 --- a/packages/richtext-lexical/src/features/blocks/server/nodes/InlineBlocksNode.tsx +++ b/packages/richtext-lexical/src/features/blocks/server/nodes/InlineBlocksNode.tsx @@ -47,7 +47,7 @@ export class ServerInlineBlockNode extends DecoratorNode | null { + static override importDOM(): DOMConversionMap | null { return {} } - static importJSON(serializedNode: SerializedInlineBlockNode): ServerInlineBlockNode { + static override importJSON(serializedNode: SerializedInlineBlockNode): ServerInlineBlockNode { const node = $createServerInlineBlockNode(serializedNode.fields) return node } @@ -75,18 +75,18 @@ export class ServerInlineBlockNode extends DecoratorNode ) export class HorizontalRuleNode extends HorizontalRuleServerNode { - static clone(node: HorizontalRuleServerNode): HorizontalRuleServerNode { + static override clone(node: HorizontalRuleServerNode): HorizontalRuleServerNode { return super.clone(node) } - static getType(): string { + static override getType(): string { return super.getType() } /** * The data for this node is stored serialized as JSON. This is the "load function" of that node: it takes the saved data and converts it into a node. */ - static importJSON(serializedNode: SerializedHorizontalRuleNode): HorizontalRuleNode { + static override importJSON(serializedNode: SerializedHorizontalRuleNode): HorizontalRuleNode { return $createHorizontalRuleNode() } /** * Allows you to render a React component within whatever createDOM returns. */ - decorate(): React.ReactElement { + override decorate(): React.ReactElement { return } - exportJSON(): SerializedLexicalNode { + override exportJSON(): SerializedLexicalNode { return super.exportJSON() } } diff --git a/packages/richtext-lexical/src/features/horizontalRule/server/nodes/HorizontalRuleNode.tsx b/packages/richtext-lexical/src/features/horizontalRule/server/nodes/HorizontalRuleNode.tsx index 4fa1b9196..912093639 100644 --- a/packages/richtext-lexical/src/features/horizontalRule/server/nodes/HorizontalRuleNode.tsx +++ b/packages/richtext-lexical/src/features/horizontalRule/server/nodes/HorizontalRuleNode.tsx @@ -36,11 +36,11 @@ export const INSERT_HORIZONTAL_RULE_COMMAND: LexicalCommand = createComman * If we used DecoratorBlockNode instead, we would only need a decorate method */ export class HorizontalRuleServerNode extends DecoratorNode { - static clone(node: HorizontalRuleServerNode): HorizontalRuleServerNode { + static override clone(node: HorizontalRuleServerNode): HorizontalRuleServerNode { return new this(node.__key) } - static getType(): string { + static override getType(): string { return 'horizontalrule' } @@ -49,7 +49,7 @@ export class HorizontalRuleServerNode extends DecoratorNode Lexical converter */ - static importDOM(): DOMConversionMap | null { + static override importDOM(): DOMConversionMap | null { return { hr: () => ({ conversion: $convertHorizontalRuleElement, @@ -61,20 +61,22 @@ export class HorizontalRuleServerNode extends DecoratorNode HTML converter */ - exportDOM(): DOMExportOutput { + override exportDOM(): DOMExportOutput { return { element: document.createElement('hr') } } /** * Opposite of importJSON. This determines what data is saved in the database / in the lexical editor state. */ - exportJSON(): SerializedLexicalNode { + override exportJSON(): SerializedLexicalNode { return { type: 'horizontalrule', version: 1, } } - getTextContent(): string { + override getTextContent(): string { return '\n' } - isInline(): false { + override isInline(): false { return false } - updateDOM(): boolean { + override updateDOM(): boolean { return false } } diff --git a/packages/richtext-lexical/src/features/link/nodes/AutoLinkNode.ts b/packages/richtext-lexical/src/features/link/nodes/AutoLinkNode.ts index 9dfdd71b2..be08f7b8e 100644 --- a/packages/richtext-lexical/src/features/link/nodes/AutoLinkNode.ts +++ b/packages/richtext-lexical/src/features/link/nodes/AutoLinkNode.ts @@ -10,20 +10,20 @@ import { LinkNode } from './LinkNode.js' // allow typing within the link export class AutoLinkNode extends LinkNode { - static clone(node: AutoLinkNode): AutoLinkNode { + static override clone(node: AutoLinkNode): AutoLinkNode { return new AutoLinkNode({ id: '', fields: node.__fields, key: node.__key }) } - static getType(): string { + static override getType(): string { return 'autolink' } - static importDOM(): null { + static override importDOM(): null { // TODO: Should link node should handle the import over autolink? return null } - static importJSON(serializedNode: SerializedAutoLinkNode): AutoLinkNode { + static override importJSON(serializedNode: SerializedAutoLinkNode): AutoLinkNode { if ( serializedNode.version === 1 && typeof serializedNode.fields?.doc?.value === 'object' && @@ -55,7 +55,7 @@ export class AutoLinkNode extends LinkNode { } } - insertNewAfter(selection: RangeSelection, restoreSelection = true): ElementNode | null { + override insertNewAfter(selection: RangeSelection, restoreSelection = true): ElementNode | null { const element = this.getParentOrThrow().insertNewAfter(selection, restoreSelection) if ($isElementNode(element)) { const linkNode = $createAutoLinkNode({ fields: this.__fields }) diff --git a/packages/richtext-lexical/src/features/link/nodes/LinkNode.ts b/packages/richtext-lexical/src/features/link/nodes/LinkNode.ts index a61cb96c2..6a3951983 100644 --- a/packages/richtext-lexical/src/features/link/nodes/LinkNode.ts +++ b/packages/richtext-lexical/src/features/link/nodes/LinkNode.ts @@ -49,7 +49,7 @@ export class LinkNode extends ElementNode { this.__id = id } - static clone(node: LinkNode): LinkNode { + static override clone(node: LinkNode): LinkNode { return new LinkNode({ id: node.__id, fields: node.__fields, @@ -57,11 +57,11 @@ export class LinkNode extends ElementNode { }) } - static getType(): string { + static override getType(): string { return 'link' } - static importDOM(): DOMConversionMap | null { + static override importDOM(): DOMConversionMap | null { return { a: (node: Node) => ({ conversion: $convertAnchorElement, @@ -70,7 +70,7 @@ export class LinkNode extends ElementNode { } } - static importJSON(serializedNode: SerializedLinkNode): LinkNode { + static override importJSON(serializedNode: SerializedLinkNode): LinkNode { if ( serializedNode.version === 1 && typeof serializedNode.fields?.doc?.value === 'object' && @@ -95,19 +95,19 @@ export class LinkNode extends ElementNode { return node } - canBeEmpty(): false { + override canBeEmpty(): false { return false } - canInsertTextAfter(): false { + override canInsertTextAfter(): false { return false } - canInsertTextBefore(): false { + override canInsertTextBefore(): false { return false } - createDOM(config: EditorConfig): HTMLAnchorElement { + override createDOM(config: EditorConfig): HTMLAnchorElement { const element = document.createElement('a') if (this.__fields?.linkType === 'custom') { element.href = this.sanitizeUrl(this.__fields.url ?? '') @@ -124,7 +124,7 @@ export class LinkNode extends ElementNode { return element } - exportJSON(): SerializedLinkNode { + override exportJSON(): SerializedLinkNode { const fields = this.getFields() if (fields?.linkType === 'internal') { @@ -146,7 +146,7 @@ export class LinkNode extends ElementNode { return returnObject } - extractWithChild( + override extractWithChild( child: LexicalNode, selection: BaseSelection, destination: 'clone' | 'html', @@ -173,7 +173,10 @@ export class LinkNode extends ElementNode { return this.getLatest().__id } - insertNewAfter(selection: RangeSelection, restoreSelection = true): ElementNodeType | null { + override insertNewAfter( + selection: RangeSelection, + restoreSelection = true, + ): ElementNodeType | null { const element = this.getParentOrThrow().insertNewAfter(selection, restoreSelection) if ($isElementNode(element)) { const linkNode = $createLinkNode({ fields: this.__fields }) @@ -183,7 +186,7 @@ export class LinkNode extends ElementNode { return null } - isInline(): true { + override isInline(): true { return true } @@ -205,7 +208,7 @@ export class LinkNode extends ElementNode { writable.__fields = fields } - updateDOM(prevNode: LinkNode, anchor: HTMLAnchorElement, config: EditorConfig): boolean { + override updateDOM(prevNode: LinkNode, anchor: HTMLAnchorElement, config: EditorConfig): boolean { const url = this.__fields?.url const newTab = this.__fields?.newTab if (url != null && url !== prevNode.__fields?.url && this.__fields?.linkType === 'custom') { diff --git a/packages/richtext-lexical/src/features/migrations/lexicalPluginToLexical/nodes/unknownConvertedNode/index.tsx b/packages/richtext-lexical/src/features/migrations/lexicalPluginToLexical/nodes/unknownConvertedNode/index.tsx index b345d09e3..4ee45ff8c 100644 --- a/packages/richtext-lexical/src/features/migrations/lexicalPluginToLexical/nodes/unknownConvertedNode/index.tsx +++ b/packages/richtext-lexical/src/features/migrations/lexicalPluginToLexical/nodes/unknownConvertedNode/index.tsx @@ -32,18 +32,18 @@ export class UnknownConvertedNode extends DecoratorNode { this.__data = data } - static clone(node: UnknownConvertedNode): UnknownConvertedNode { + static override clone(node: UnknownConvertedNode): UnknownConvertedNode { return new UnknownConvertedNode({ data: node.__data, key: node.__key, }) } - static getType(): string { + static override getType(): string { return 'unknownConverted' } - static importJSON(serializedNode: SerializedUnknownConvertedNode): UnknownConvertedNode { + static override importJSON(serializedNode: SerializedUnknownConvertedNode): UnknownConvertedNode { const node = $createUnknownConvertedNode({ data: serializedNode.data }) return node } @@ -56,17 +56,17 @@ export class UnknownConvertedNode extends DecoratorNode { return true } - createDOM(config: EditorConfig): HTMLElement { + override createDOM(config: EditorConfig): HTMLElement { const element = document.createElement('span') addClassNamesToElement(element, 'unknownConverted') return element } - decorate(): JSX.Element { + override decorate(): JSX.Element { return } - exportJSON(): SerializedUnknownConvertedNode { + override exportJSON(): SerializedUnknownConvertedNode { return { type: this.getType(), data: this.__data, @@ -76,11 +76,11 @@ export class UnknownConvertedNode extends DecoratorNode { // Mutation - isInline(): boolean { + override isInline(): boolean { return true } - updateDOM(prevNode: UnknownConvertedNode, dom: HTMLElement): boolean { + override updateDOM(prevNode: UnknownConvertedNode, dom: HTMLElement): boolean { return false } } diff --git a/packages/richtext-lexical/src/features/migrations/slateToLexical/nodes/unknownConvertedNode/index.tsx b/packages/richtext-lexical/src/features/migrations/slateToLexical/nodes/unknownConvertedNode/index.tsx index b345d09e3..4ee45ff8c 100644 --- a/packages/richtext-lexical/src/features/migrations/slateToLexical/nodes/unknownConvertedNode/index.tsx +++ b/packages/richtext-lexical/src/features/migrations/slateToLexical/nodes/unknownConvertedNode/index.tsx @@ -32,18 +32,18 @@ export class UnknownConvertedNode extends DecoratorNode { this.__data = data } - static clone(node: UnknownConvertedNode): UnknownConvertedNode { + static override clone(node: UnknownConvertedNode): UnknownConvertedNode { return new UnknownConvertedNode({ data: node.__data, key: node.__key, }) } - static getType(): string { + static override getType(): string { return 'unknownConverted' } - static importJSON(serializedNode: SerializedUnknownConvertedNode): UnknownConvertedNode { + static override importJSON(serializedNode: SerializedUnknownConvertedNode): UnknownConvertedNode { const node = $createUnknownConvertedNode({ data: serializedNode.data }) return node } @@ -56,17 +56,17 @@ export class UnknownConvertedNode extends DecoratorNode { return true } - createDOM(config: EditorConfig): HTMLElement { + override createDOM(config: EditorConfig): HTMLElement { const element = document.createElement('span') addClassNamesToElement(element, 'unknownConverted') return element } - decorate(): JSX.Element { + override decorate(): JSX.Element { return } - exportJSON(): SerializedUnknownConvertedNode { + override exportJSON(): SerializedUnknownConvertedNode { return { type: this.getType(), data: this.__data, @@ -76,11 +76,11 @@ export class UnknownConvertedNode extends DecoratorNode { // Mutation - isInline(): boolean { + override isInline(): boolean { return true } - updateDOM(prevNode: UnknownConvertedNode, dom: HTMLElement): boolean { + override updateDOM(prevNode: UnknownConvertedNode, dom: HTMLElement): boolean { return false } } diff --git a/packages/richtext-lexical/src/features/relationship/client/nodes/RelationshipNode.tsx b/packages/richtext-lexical/src/features/relationship/client/nodes/RelationshipNode.tsx index 91436f32f..3c2d7c657 100644 --- a/packages/richtext-lexical/src/features/relationship/client/nodes/RelationshipNode.tsx +++ b/packages/richtext-lexical/src/features/relationship/client/nodes/RelationshipNode.tsx @@ -38,15 +38,15 @@ function $relationshipElementToNode(domNode: HTMLDivElement): DOMConversionOutpu } export class RelationshipNode extends RelationshipServerNode { - static clone(node: RelationshipServerNode): RelationshipServerNode { + static override clone(node: RelationshipServerNode): RelationshipServerNode { return super.clone(node) } - static getType(): string { + static override getType(): string { return super.getType() } - static importDOM(): DOMConversionMap | null { + static override importDOM(): DOMConversionMap | null { return { div: (domNode: HTMLDivElement) => { if ( @@ -63,7 +63,7 @@ export class RelationshipNode extends RelationshipServerNode { } } - static importJSON(serializedNode: SerializedRelationshipNode): RelationshipNode { + static override importJSON(serializedNode: SerializedRelationshipNode): RelationshipNode { if (serializedNode.version === 1 && (serializedNode?.value as unknown as { id: string })?.id) { serializedNode.value = (serializedNode.value as unknown as { id: string }).id } @@ -77,7 +77,7 @@ export class RelationshipNode extends RelationshipServerNode { return node } - decorate(editor: LexicalEditor, config: EditorConfig): JSX.Element { + override decorate(editor: LexicalEditor, config: EditorConfig): JSX.Element { return ( | null { + static override importDOM(): DOMConversionMap | null { return { div: (domNode: HTMLDivElement) => { if ( @@ -86,7 +86,7 @@ export class RelationshipServerNode extends DecoratorBlockNode { } } - static importJSON(serializedNode: SerializedRelationshipNode): RelationshipServerNode { + static override importJSON(serializedNode: SerializedRelationshipNode): RelationshipServerNode { if (serializedNode.version === 1 && (serializedNode?.value as unknown as { id: string })?.id) { serializedNode.value = (serializedNode.value as unknown as { id: string }).id } @@ -104,11 +104,11 @@ export class RelationshipServerNode extends DecoratorBlockNode { return false } - decorate(_editor: LexicalEditor, _config: EditorConfig): JSX.Element | null { + override decorate(_editor: LexicalEditor, _config: EditorConfig): JSX.Element | null { return null } - exportDOM(): DOMExportOutput { + override exportDOM(): DOMExportOutput { const element = document.createElement('div') element.setAttribute( 'data-lexical-relationship-id', @@ -121,7 +121,7 @@ export class RelationshipServerNode extends DecoratorBlockNode { return { element } } - exportJSON(): SerializedRelationshipNode { + override exportJSON(): SerializedRelationshipNode { return { ...super.exportJSON(), ...this.getData(), @@ -134,7 +134,7 @@ export class RelationshipServerNode extends DecoratorBlockNode { return this.getLatest().__data } - getTextContent(): string { + override getTextContent(): string { return `${this.__data?.relationTo} relation to ${typeof this.__data?.value === 'object' ? this.__data?.value?.id : this.__data?.value}` } diff --git a/packages/richtext-lexical/src/features/upload/client/nodes/UploadNode.tsx b/packages/richtext-lexical/src/features/upload/client/nodes/UploadNode.tsx index e414e37cd..b64a3d734 100644 --- a/packages/richtext-lexical/src/features/upload/client/nodes/UploadNode.tsx +++ b/packages/richtext-lexical/src/features/upload/client/nodes/UploadNode.tsx @@ -49,15 +49,15 @@ export type SerializedUploadNode = { } & Spread export class UploadNode extends UploadServerNode { - static clone(node: UploadServerNode): UploadServerNode { + static override clone(node: UploadServerNode): UploadServerNode { return super.clone(node) } - static getType(): string { + static override getType(): string { return super.getType() } - static importDOM(): DOMConversionMap { + static override importDOM(): DOMConversionMap { return { img: (node) => ({ conversion: $convertUploadElement, @@ -66,7 +66,7 @@ export class UploadNode extends UploadServerNode { } } - static importJSON(serializedNode: SerializedUploadNode): UploadNode { + static override importJSON(serializedNode: SerializedUploadNode): UploadNode { if (serializedNode.version === 1 && (serializedNode?.value as unknown as { id: string })?.id) { serializedNode.value = (serializedNode.value as unknown as { id: string }).id } @@ -88,11 +88,11 @@ export class UploadNode extends UploadServerNode { return node } - decorate(): JSX.Element { + override decorate(): JSX.Element { return } - exportJSON(): SerializedUploadNode { + override exportJSON(): SerializedUploadNode { return super.exportJSON() } } diff --git a/packages/richtext-lexical/src/features/upload/server/nodes/UploadNode.tsx b/packages/richtext-lexical/src/features/upload/server/nodes/UploadNode.tsx index ce3965cfd..95875fcc8 100644 --- a/packages/richtext-lexical/src/features/upload/server/nodes/UploadNode.tsx +++ b/packages/richtext-lexical/src/features/upload/server/nodes/UploadNode.tsx @@ -85,7 +85,7 @@ export class UploadServerNode extends DecoratorBlockNode { this.__data = data } - static clone(node: UploadServerNode): UploadServerNode { + static override clone(node: UploadServerNode): UploadServerNode { return new this({ data: node.__data, format: node.__format, @@ -93,11 +93,11 @@ export class UploadServerNode extends DecoratorBlockNode { }) } - static getType(): string { + static override getType(): string { return 'upload' } - static importDOM(): DOMConversionMap { + static override importDOM(): DOMConversionMap { return { img: (node) => ({ conversion: $convertUploadServerElement, @@ -106,7 +106,7 @@ export class UploadServerNode extends DecoratorBlockNode { } } - static importJSON(serializedNode: SerializedUploadNode): UploadServerNode { + static override importJSON(serializedNode: SerializedUploadNode): UploadServerNode { if (serializedNode.version === 1 && (serializedNode?.value as unknown as { id: string })?.id) { serializedNode.value = (serializedNode.value as unknown as { id: string }).id } @@ -132,12 +132,12 @@ export class UploadServerNode extends DecoratorBlockNode { return false } - decorate(): JSX.Element { + override decorate(): JSX.Element { // @ts-expect-error return } - exportDOM(): DOMExportOutput { + override exportDOM(): DOMExportOutput { const element = document.createElement('img') element.setAttribute('data-lexical-upload-id', String(this.__data?.value)) element.setAttribute('data-lexical-upload-relation-to', this.__data?.relationTo) @@ -145,7 +145,7 @@ export class UploadServerNode extends DecoratorBlockNode { return { element } } - exportJSON(): SerializedUploadNode { + override exportJSON(): SerializedUploadNode { return { ...super.exportJSON(), ...this.getData(), @@ -163,7 +163,7 @@ export class UploadServerNode extends DecoratorBlockNode { writable.__data = data } - updateDOM(): false { + override updateDOM(): false { return false } } diff --git a/packages/richtext-lexical/tsconfig.json b/packages/richtext-lexical/tsconfig.json index 3a7de719d..a553c8a90 100644 --- a/packages/richtext-lexical/tsconfig.json +++ b/packages/richtext-lexical/tsconfig.json @@ -2,8 +2,7 @@ "extends": "../../tsconfig.base.json", "compilerOptions": { /* TODO: remove the following lines */ - "noUncheckedIndexedAccess": false, - "noImplicitOverride": false + "noUncheckedIndexedAccess": false }, "references": [ { "path": "../payload" }, diff --git a/packages/richtext-slate/tsconfig.json b/packages/richtext-slate/tsconfig.json index 1464398dc..b28e8a065 100644 --- a/packages/richtext-slate/tsconfig.json +++ b/packages/richtext-slate/tsconfig.json @@ -11,7 +11,6 @@ /* TODO: remove the following lines */ "strict": false, "noUncheckedIndexedAccess": false, - "noImplicitOverride": false, }, "exclude": [ "dist", diff --git a/packages/storage-azure/tsconfig.json b/packages/storage-azure/tsconfig.json index b8eda6d59..67791916a 100644 --- a/packages/storage-azure/tsconfig.json +++ b/packages/storage-azure/tsconfig.json @@ -9,7 +9,6 @@ /* TODO: remove the following lines */ "noUncheckedIndexedAccess": false, - "noImplicitOverride": false, }, "exclude": ["dist", "node_modules"], "include": ["src/**/*.ts", "src/**/*.tsx", "src/**/*.d.ts", "src/**/*.json"], diff --git a/packages/storage-uploadthing/tsconfig.json b/packages/storage-uploadthing/tsconfig.json index 803fd1e43..e91d20116 100644 --- a/packages/storage-uploadthing/tsconfig.json +++ b/packages/storage-uploadthing/tsconfig.json @@ -4,7 +4,6 @@ /* TODO: remove the following lines */ "strict": false, "noUncheckedIndexedAccess": false, - "noImplicitOverride": false, }, "references": [{ "path": "../payload" }, { "path": "../plugin-cloud-storage" }] } diff --git a/packages/translations/tsconfig.json b/packages/translations/tsconfig.json index 83ccf9536..5a894e7e8 100644 --- a/packages/translations/tsconfig.json +++ b/packages/translations/tsconfig.json @@ -4,6 +4,5 @@ /* TODO: remove the following lines */ "strict": false, "noUncheckedIndexedAccess": false, - "noImplicitOverride": false, } } diff --git a/packages/ui/tsconfig.json b/packages/ui/tsconfig.json index 680d5fb20..ce82aadf9 100644 --- a/packages/ui/tsconfig.json +++ b/packages/ui/tsconfig.json @@ -4,7 +4,6 @@ /* TODO: remove the following lines */ "strict": false, "noUncheckedIndexedAccess": false, - "noImplicitOverride": false, }, "references": [{ "path": "../payload" }, { "path": "../translations" }] }