build: Replace Codelyzer and TSLint with Angular ESLint

Migrate from the deprecated TSLint to Angluar ESLint. Also fix current
linting issues in the code, in particular:

- Use strict equals operators (=== and !==)
- Remove empty lifecycle methods (mostly ngOnInit)
- Output bindings including aliases should not be named as standard dom
  events (submit)
- Async pipe results should not be negated
This commit is contained in:
Ralph Hopman
2024-11-08 09:37:08 +01:00
committed by Adam Saghy
parent e910679673
commit 9034ce2847
204 changed files with 2184 additions and 1173 deletions
@@ -219,7 +219,7 @@
<button mat-raised-button [routerLink]="['../']">
{{"labels.buttons.Cancel" | translate}}
</button>
<button mat-raised-button color="primary" (click)="submit.emit()">
<button mat-raised-button color="primary" (click)="submitEvent.emit()">
{{"labels.buttons.Submit" | translate}}
</button>
</div>
@@ -19,7 +19,7 @@ export class ClientPreviewStepComponent {
@Input() client: any;
/** Form submission event */
@Output() submit = new EventEmitter();
@Output() submitEvent = new EventEmitter();
constructor() { }
@@ -1,5 +1,5 @@
/** Angular Imports */
import { Component, OnInit } from '@angular/core';
import { Component } from '@angular/core';
import { ActivatedRoute, Router } from '@angular/router';
import { ClientsService } from 'app/clients/clients.service';
@@ -11,7 +11,7 @@ import { ClientsService } from 'app/clients/clients.service';
templateUrl: './view-charge.component.html',
styleUrls: ['./view-charge.component.scss']
})
export class ViewChargeComponent implements OnInit {
export class ViewChargeComponent {
/** Charge Data. */
chargeData: any;
@@ -31,10 +31,6 @@ export class ViewChargeComponent implements OnInit {
});
}
ngOnInit() {
}
/**
* Waive Charge.
*/
@@ -192,7 +192,7 @@
<button mat-menu-item (click)="doAction('Client Screen Reports')"> {{"labels.buttons.Client Screen Reports" | translate}} </button>
<button mat-menu-item (click)="doAction('Create Standing Instructions')"
*mifosxHasPermission="'CREATE_STANDINGINSTRUCTION'"> {{"labels.buttons.Create Standing Instructions" | translate}}</button>
<span *ngIf="clientViewData.status.value!='Transfer on hold'">
<span *ngIf="clientViewData.status.value!=='Transfer on hold'">
<button mat-menu-item (click)="doAction('View Standing Instructions')"
*mifosxHasPermission="'READ_STANDINGINSTRUCTION'"> {{"labels.buttons.View Standing Instructions" | translate}}</button>
</span>
@@ -1,4 +1,4 @@
import { Component, OnInit } from '@angular/core';
import { Component } from '@angular/core';
import { ActivatedRoute } from '@angular/router';
@Component({
@@ -6,7 +6,7 @@ import { ActivatedRoute } from '@angular/router';
templateUrl: './datatable-tab.component.html',
styleUrls: ['./datatable-tab.component.scss']
})
export class DatatableTabComponent implements OnInit {
export class DatatableTabComponent {
entityId: string;
entityDatatable: any;
multiRowDatatableFlag: boolean;
@@ -20,7 +20,4 @@ export class DatatableTabComponent implements OnInit {
});
}
ngOnInit() {
}
}
@@ -1,4 +1,4 @@
import { Component, OnInit } from '@angular/core';
import { Component } from '@angular/core';
import { ActivatedRoute } from '@angular/router';
import { MatDialog } from '@angular/material/dialog';
@@ -10,7 +10,7 @@ import { ClientsService } from '../../clients.service';
templateUrl: './documents-tab.component.html',
styleUrls: ['./documents-tab.component.scss']
})
export class DocumentsTabComponent implements OnInit {
export class DocumentsTabComponent {
entityDocuments: any;
entityId: string;
entityType = 'clients';
@@ -24,9 +24,6 @@ export class DocumentsTabComponent implements OnInit {
this.entityId = this.route.parent.snapshot.paramMap.get('clientId');
}
ngOnInit() {
}
downloadDocument(documentId: string) {
this.clientsService.downloadClientDocument(this.entityId, documentId).subscribe(res => {
const url = window.URL.createObjectURL(res);
@@ -1,5 +1,5 @@
/** Angular Imports */
import { Component, OnInit } from '@angular/core';
import { Component } from '@angular/core';
import { ActivatedRoute } from '@angular/router';
/** Custom Components */
@@ -16,7 +16,7 @@ import { AuthenticationService } from 'app/core/authentication/authentication.se
templateUrl: './notes-tab.component.html',
styleUrls: ['./notes-tab.component.scss']
})
export class NotesTabComponent implements OnInit {
export class NotesTabComponent {
/** Client ID */
entityId: string;
@@ -41,8 +41,6 @@ export class NotesTabComponent implements OnInit {
});
}
ngOnInit() { }
/**
* Edits a client note.
* @param {string} noteId Note Id
@@ -63,7 +63,7 @@
<mifosx-client-preview-step
[clientTemplate]="clientTemplate"
[clientAddressFieldConfig]="clientAddressFieldConfig"
[client]="client" (submit)="submit()"
[client]="client" (submitEvent)="submit()"
>
</mifosx-client-preview-step>