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
@@ -66,7 +66,7 @@
[savingsAccountTemplate]="savingsAccountTemplate"
[savingsAccountTermsForm]="savingsAccountTermsForm"
[savingsAccount]="savingsAccount"
(submit)="submit()"
(submitEvent)="submit()"
>
</mifosx-savings-account-preview-step>
@@ -67,7 +67,7 @@
[savingsAccountTemplate]="savingsAccountAndTemplate"
[savingsAccountTermsForm]="savingsAccountTermsForm"
[savingsAccount]="savingsAccount"
(submit)="submit()"
(submitEvent)="submit()"
>
</mifosx-savings-account-preview-step>
@@ -67,7 +67,7 @@
[savingsAccountTemplate]="savingsAccountTemplate"
[savingsAccountTermsForm]="savingsAccountTermsForm"
[savingsAccount]="savingsAccount"
(submit)="submit()"
(submitEvent)="submit()"
>
</mifosx-savings-account-preview-step>
@@ -1,5 +1,5 @@
/** Angular Imports */
import { Component, OnInit, ViewChild } from '@angular/core';
import { Component, ViewChild } from '@angular/core';
import { Router, ActivatedRoute } from '@angular/router';
/** Custom Components */
@@ -21,7 +21,7 @@ import { Dates } from 'app/core/utils/dates';
styleUrls: ['./create-gsim-account.component.scss']
})
export class CreateGsimAccountComponent implements OnInit {
export class CreateGsimAccountComponent {
/** Savings Account Template */
savingsAccountTemplate: any;
@@ -59,9 +59,6 @@ export class CreateGsimAccountComponent implements OnInit {
});
}
ngOnInit(): void {
}
/**
* Sets savings account product template.
* @param {any} $event API response
@@ -197,7 +197,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>
@@ -25,7 +25,7 @@ export class SavingsAccountPreviewStepComponent {
chargesDisplayedColumns: string[] = ['name', 'chargeCalculationType', 'amount', 'chargeTimeType', 'date', 'repaymentsEvery'];
/** Form submission event */
@Output() submit = new EventEmitter();
@Output() submitEvent = new EventEmitter();
constructor(private translateService: TranslateService) { }
@@ -1,4 +1,4 @@
import { Component, OnInit } from '@angular/core';
import { Component } from '@angular/core';
import { ActivatedRoute, Router } from '@angular/router';
import { Currency } from 'app/shared/models/general.model';
@@ -7,7 +7,7 @@ import { Currency } from 'app/shared/models/general.model';
templateUrl: './general-tab.component.html',
styleUrls: ['./general-tab.component.scss']
})
export class GeneralTabComponent implements OnInit {
export class GeneralTabComponent {
isLoading = true;
isActive = false;
entityType: string;
@@ -33,7 +33,4 @@ export class GeneralTabComponent implements OnInit {
}
}
ngOnInit(): void {
}
}
@@ -1,4 +1,4 @@
import { Component, OnInit, ViewChild } from '@angular/core';
import { Component } from '@angular/core';
import { ActivatedRoute } from '@angular/router';
import { AuthenticationService } from 'app/core/authentication/authentication.service';
import { SavingsService } from 'app/savings/savings.service';
@@ -8,7 +8,7 @@ import { SavingsService } from 'app/savings/savings.service';
templateUrl: './notes-tab.component.html',
styleUrls: ['./notes-tab.component.scss']
})
export class NotesTabComponent implements OnInit {
export class NotesTabComponent {
entityId: string;
username: string;
@@ -25,9 +25,6 @@ export class NotesTabComponent implements OnInit {
});
}
ngOnInit() {
}
addNote(noteContent: any) {
this.savingsService.createSavingsNote(this.entityId, noteContent).subscribe((response: any) => {
this.entityNotes.push({
@@ -1,7 +1,6 @@
import { Component, OnInit } from '@angular/core';
import { Component } from '@angular/core';
import { MatDialog } from '@angular/material/dialog';
import { ActivatedRoute } from '@angular/router';
import { UploadDocumentDialogComponent } from 'app/clients/clients-view/custom-dialogs/upload-document-dialog/upload-document-dialog.component';
import { SavingsService } from 'app/savings/savings.service';
import { SettingsService } from 'app/settings/settings.service';
import { environment } from 'environments/environment';
@@ -11,7 +10,7 @@ import { environment } from 'environments/environment';
templateUrl: './savings-documents-tab.component.html',
styleUrls: ['./savings-documents-tab.component.scss']
})
export class SavingsDocumentsTabComponent implements OnInit {
export class SavingsDocumentsTabComponent {
/** Stores the resolved savings documents data */
entityDocuments: any;
@@ -33,9 +32,6 @@ export class SavingsDocumentsTabComponent implements OnInit {
this.entityId = this.route.parent.snapshot.paramMap.get('savingAccountId');
}
ngOnInit() {
}
setSavingsDocumentsData(data: any) {
data.forEach((ele: any) => {
ele.docUrl = this.settingsService.serverUrl + '/savings/' + ele.parentEntityId + '/documents/' + ele.id + '/attachment?tenantIdentifier=' + environment.fineractPlatformTenantId;
@@ -1,15 +1,12 @@
import { Component, OnInit } from '@angular/core';
import { Component } from '@angular/core';
@Component({
selector: 'mifosx-savings-transaction-datatable-tab',
templateUrl: './savings-transaction-datatable-tab.component.html',
styleUrls: ['./savings-transaction-datatable-tab.component.scss']
})
export class SavingsTransactionDatatableTabComponent implements OnInit {
export class SavingsTransactionDatatableTabComponent {
constructor() { }
ngOnInit(): void {
}
}
@@ -2,8 +2,8 @@
<span
*ngIf="!(transactionData.interestedPostedAsOn === false && (transactionData.transactionType.id === 17 || transactionData.transactionType.id === 3))">
<span *mifosxHasPermission="'ADJUSTTRANSACTION_SAVINGSACCOUNT'">
<button mat-raised-button color="primary" *ngIf="transactionData.transactionType.value == 'Transfer' || transactionData.reversed == 'true'
|| transactionData.transactionType.id==3 || transactionData.transactionType.id==17" [routerLink]="'edit'">
<button mat-raised-button color="primary" *ngIf="transactionData.transactionType.value === 'Transfer' || transactionData.reversed === 'true'
|| transactionData.transactionType.id===3 || transactionData.transactionType.id===17" [routerLink]="'edit'">
<fa-icon icon="edit" class="m-r-10"></fa-icon>{{"labels.buttons.Edit" | translate}}
</button>
</span>
@@ -1,4 +1,4 @@
import { Component, OnInit } from '@angular/core';
import { Component } from '@angular/core';
import { MatDialog } from '@angular/material/dialog';
import { ActivatedRoute, Router } from '@angular/router';
import { Dates } from 'app/core/utils/dates';
@@ -12,7 +12,7 @@ import { SettingsService } from 'app/settings/settings.service';
templateUrl: './savings-transaction-general-tab.component.html',
styleUrls: ['./savings-transaction-general-tab.component.scss']
})
export class SavingsTransactionGeneralTabComponent implements OnInit {
export class SavingsTransactionGeneralTabComponent {
accountId: string;
transactionId: string;
@@ -30,9 +30,6 @@ export class SavingsTransactionGeneralTabComponent implements OnInit {
});
}
ngOnInit(): void {
}
allowUndo(): boolean {
if (this.transactionData.reversed && this.transactionData.transactionType.amountHold) {
return false;