Skip to content

Commit 97dc313

Browse files
committed
refactor: fix lint error and update ci build node versions
1 parent 456dc8f commit 97dc313

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

.github/workflows/node.js.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212

1313
strategy:
1414
matrix:
15-
node-version: [18.x, 20.x]
15+
node-version: [20.x, 22.x, 24.x]
1616

1717
steps:
1818
- uses: actions/checkout@v3

projects/ngx-diff/src/lib/components/side-by-side-diff/side-by-side-diff.component.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Component, EventEmitter, Input, OnChanges, OnInit, Output } from '@angular/core';
1+
import { Component, EventEmitter, Input, OnChanges, OnInit, Output, inject } from '@angular/core';
22
import { Diff, DiffOp } from 'diff-match-patch-ts';
33
import { DiffMatchPatchService } from '../../services/diff-match-patch/diff-match-patch.service';
44

@@ -32,6 +32,8 @@ interface ILine {
3232
styleUrl: './side-by-side-diff.component.scss'
3333
})
3434
export class SideBySideDiffComponent implements OnInit, OnChanges {
35+
private readonly dmp = inject(DiffMatchPatchService);
36+
3537
/**
3638
* Optional title to be displayed at the top of the diff.
3739
*/
@@ -64,8 +66,6 @@ export class SideBySideDiffComponent implements OnInit, OnChanges {
6466
public afterLines: ILine[] = [];
6567
public selectedLineIndex?: number;
6668

67-
public constructor(private readonly dmp: DiffMatchPatchService) {}
68-
6969
public ngOnInit(): void {
7070
this.update();
7171
}

projects/ngx-diff/src/lib/components/unified-diff/unified-diff.component.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { Diff, DiffOp } from 'diff-match-patch-ts';
22

3-
import { Component, EventEmitter, Input, OnChanges, OnInit, Output } from '@angular/core';
3+
import { Component, EventEmitter, Input, OnChanges, OnInit, Output, inject } from '@angular/core';
44

55
import { IDiffCalculation } from '../../common/diff-calculation.interface';
66
import { LineDiffType } from '../../common/line-diff-type';
@@ -26,6 +26,8 @@ type LineDiff = {
2626
styleUrl: './unified-diff.component.scss'
2727
})
2828
export class UnifiedDiffComponent implements OnInit, OnChanges {
29+
private readonly dmp = inject(DiffMatchPatchService);
30+
2931
/**
3032
* Optional title to be displayed at the top of the diff.
3133
*/
@@ -53,8 +55,6 @@ export class UnifiedDiffComponent implements OnInit, OnChanges {
5355
public selectedLine?: LineDiff;
5456
public isContentEqual: boolean = false;
5557

56-
public constructor(private readonly dmp: DiffMatchPatchService) {}
57-
5858
public ngOnInit(): void {
5959
this.updateHtml();
6060
}

0 commit comments

Comments
 (0)