]> BookStack Code Mirror - bookstack/commitdiff
TypeScript: Updated compile target, addressed issues 5725/head
authorDan Brown <redacted>
Wed, 23 Jul 2025 14:41:55 +0000 (15:41 +0100)
committerDan Brown <redacted>
Wed, 23 Jul 2025 14:41:55 +0000 (15:41 +0100)
resources/js/wysiwyg/lexical/core/LexicalNode.ts
resources/js/wysiwyg/lexical/core/nodes/LexicalDecoratorNode.ts
resources/js/wysiwyg/lexical/core/nodes/LexicalElementNode.ts
resources/js/wysiwyg/lexical/core/nodes/LexicalLineBreakNode.ts
resources/js/wysiwyg/lexical/core/nodes/LexicalParagraphNode.ts
resources/js/wysiwyg/lexical/core/nodes/LexicalTextNode.ts
tsconfig.json

index 7306e6bca2755a578826f4bf87f37d24935ed465..6d79c01ccb108e905cc7fdac805ee2ab67f60864 100644 (file)
@@ -175,7 +175,7 @@ export type NodeKey = string;
 
 export class LexicalNode {
   // Allow us to look up the type including static props
 
 export class LexicalNode {
   // Allow us to look up the type including static props
-  ['constructor']!: KlassConstructor<typeof LexicalNode>;
+  declare ['constructor']: KlassConstructor<typeof LexicalNode>;
   /** @internal */
   __type: string;
   /** @internal */
   /** @internal */
   __type: string;
   /** @internal */
index 99d2669d92f918c616f5fb4b63996c2f3ecb07e8..5015f593ed9eb954035d4dc9cd536d2bdebd4d1d 100644 (file)
@@ -24,7 +24,7 @@ export interface DecoratorNode<T> {
 /** @noInheritDoc */
 // eslint-disable-next-line @typescript-eslint/no-unsafe-declaration-merging
 export class DecoratorNode<T> extends LexicalNode {
 /** @noInheritDoc */
 // eslint-disable-next-line @typescript-eslint/no-unsafe-declaration-merging
 export class DecoratorNode<T> extends LexicalNode {
-  ['constructor']!: KlassConstructor<typeof DecoratorNode<T>>;
+  declare ['constructor']: KlassConstructor<typeof DecoratorNode<T>>;
   constructor(key?: NodeKey) {
     super(key);
   }
   constructor(key?: NodeKey) {
     super(key);
   }
index 9ad5084114150ee04c1a45b946d61092f941ad2a..a27603773682480fd3f45922a113b357edc214a9 100644 (file)
@@ -55,7 +55,7 @@ export interface ElementNode {
 /** @noInheritDoc */
 // eslint-disable-next-line @typescript-eslint/no-unsafe-declaration-merging
 export class ElementNode extends LexicalNode {
 /** @noInheritDoc */
 // eslint-disable-next-line @typescript-eslint/no-unsafe-declaration-merging
 export class ElementNode extends LexicalNode {
-  ['constructor']!: KlassConstructor<typeof ElementNode>;
+  declare ['constructor']: KlassConstructor<typeof ElementNode>;
   /** @internal */
   __first: null | NodeKey;
   /** @internal */
   /** @internal */
   __first: null | NodeKey;
   /** @internal */
index 2d28db08c12213a82f99eb95e6b7c25b0c27373c..b1746e7f8424024cbeb71d35044476f09b066543 100644 (file)
@@ -22,7 +22,7 @@ export type SerializedLineBreakNode = SerializedLexicalNode;
 
 /** @noInheritDoc */
 export class LineBreakNode extends LexicalNode {
 
 /** @noInheritDoc */
 export class LineBreakNode extends LexicalNode {
-  ['constructor']!: KlassConstructor<typeof LineBreakNode>;
+  declare ['constructor']: KlassConstructor<typeof LineBreakNode>;
   static getType(): string {
     return 'linebreak';
   }
   static getType(): string {
     return 'linebreak';
   }
index e8d044b218bc37866f445b6c7facfd83392978f9..6711936da00c186af8fa0f81ef7614d0f5ba5504 100644 (file)
@@ -44,7 +44,7 @@ export type SerializedParagraphNode = Spread<
 
 /** @noInheritDoc */
 export class ParagraphNode extends CommonBlockNode {
 
 /** @noInheritDoc */
 export class ParagraphNode extends CommonBlockNode {
-  ['constructor']!: KlassConstructor<typeof ParagraphNode>;
+  declare ['constructor']: KlassConstructor<typeof ParagraphNode>;
   /** @internal */
   __textFormat: number;
   __textStyle: string;
   /** @internal */
   __textFormat: number;
   __textStyle: string;
index 9a486749421612245f977da0e558efd6158d3e13..35cc073a0bae814b809ab36f6ee3e30d096fd2b1 100644 (file)
@@ -284,7 +284,7 @@ export interface TextNode {
 /** @noInheritDoc */
 // eslint-disable-next-line @typescript-eslint/no-unsafe-declaration-merging
 export class TextNode extends LexicalNode {
 /** @noInheritDoc */
 // eslint-disable-next-line @typescript-eslint/no-unsafe-declaration-merging
 export class TextNode extends LexicalNode {
-  ['constructor']!: KlassConstructor<typeof TextNode>;
+  declare ['constructor']: KlassConstructor<typeof TextNode>;
   __text: string;
   /** @internal */
   __format: number;
   __text: string;
   /** @internal */
   __format: number;
index 8bffc25f89871054ceb854656721d65aac8106bb..dacaefea279c7a6886c7f0b769f2101650f4345d 100644 (file)
@@ -2,7 +2,7 @@
   "include": ["resources/js/**/*"],
   "exclude": ["resources/js/wysiwyg/lexical/yjs/*"],
   "compilerOptions": {
   "include": ["resources/js/**/*"],
   "exclude": ["resources/js/wysiwyg/lexical/yjs/*"],
   "compilerOptions": {
-    "target": "es2019",
+    "target": "es2022",
     "module": "commonjs",
     "rootDir": "./resources/js/",
     "baseUrl": "./",
     "module": "commonjs",
     "rootDir": "./resources/js/",
     "baseUrl": "./",