From 876ee1aba402ccabedb5320b97b47888b678909d Mon Sep 17 00:00:00 2001 From: Thomas Bouffard <27200110+tbouffard@users.noreply.github.com> Date: Tue, 23 Sep 2025 16:30:43 +0200 Subject: [PATCH 1/2] refactor: no implicit override in TypeScript code Easily detect when super methods are removed. --- projects/_shared/src/custom-shapes.ts | 6 +++--- projects/_shared/src/generate-graph.ts | 1 + projects/_shared/tsconfig.json | 3 ++- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/projects/_shared/src/custom-shapes.ts b/projects/_shared/src/custom-shapes.ts index 0d53251..c353041 100644 --- a/projects/_shared/src/custom-shapes.ts +++ b/projects/_shared/src/custom-shapes.ts @@ -13,7 +13,7 @@ class CustomRectangleShape extends RectangleShape { this.isRounded = true; // force rounded shape } - paintBackground( + override paintBackground( c: AbstractCanvas2D, x: number, y: number, @@ -24,7 +24,7 @@ class CustomRectangleShape extends RectangleShape { super.paintBackground(c, x, y, w, h); } - paintVertexShape( + override paintVertexShape( c: AbstractCanvas2D, x: number, y: number, @@ -41,7 +41,7 @@ class CustomEllipseShape extends EllipseShape { super(bounds, fill, stroke, 5); } - paintVertexShape( + override paintVertexShape( c: AbstractCanvas2D, x: number, y: number, diff --git a/projects/_shared/src/generate-graph.ts b/projects/_shared/src/generate-graph.ts index 0ac3edc..8fb24bf 100644 --- a/projects/_shared/src/generate-graph.ts +++ b/projects/_shared/src/generate-graph.ts @@ -30,6 +30,7 @@ class CustomGraph extends BaseGraph { // Register builtin styles PerimeterRegistry.add('ellipsePerimeter', Perimeter.EllipsePerimeter); PerimeterRegistry.add('rectanglePerimeter', Perimeter.RectanglePerimeter); // declared in the default vertex style, so must be registered to be used + EdgeStyleRegistry.add('orthogonalEdgeStyle', EdgeStyle.OrthConnector, {handlerKind: 'segment', isOrthogonal: true}); const arrowFunction = EdgeMarker.createArrow(2); diff --git a/projects/_shared/tsconfig.json b/projects/_shared/tsconfig.json index dc0e497..a1e046a 100644 --- a/projects/_shared/tsconfig.json +++ b/projects/_shared/tsconfig.json @@ -15,7 +15,8 @@ "declaration": true, "noUnusedLocals": true, "noUnusedParameters": true, - "noImplicitReturns": true + "noImplicitReturns": true, + "noImplicitOverride": true, }, "include": ["src"] } From d757f1a26512464624d07d4e45395e8f807a2db4 Mon Sep 17 00:00:00 2001 From: Thomas Bouffard <27200110+tbouffard@users.noreply.github.com> Date: Tue, 23 Sep 2025 18:47:46 +0200 Subject: [PATCH 2/2] order props in tsconfig [skip ci] --- projects/_shared/tsconfig.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/projects/_shared/tsconfig.json b/projects/_shared/tsconfig.json index a1e046a..6086cf5 100644 --- a/projects/_shared/tsconfig.json +++ b/projects/_shared/tsconfig.json @@ -15,8 +15,8 @@ "declaration": true, "noUnusedLocals": true, "noUnusedParameters": true, - "noImplicitReturns": true, "noImplicitOverride": true, + "noImplicitReturns": true, }, "include": ["src"] }