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
@@ -85,7 +85,7 @@
<mifosx-fixed-deposit-account-preview-step
[fixedDepositsAccountTemplate]="fixedDepositsAccountTemplate"
[fixedDepositsAccountProductTemplate]="fixedDepositsAccountProductTemplate"
[fixedDepositAccountData]="fixedDepositAccount" (submit)="submit()">
[fixedDepositAccountData]="fixedDepositAccount" (submitEvent)="submit()">
</mifosx-fixed-deposit-account-preview-step>
</mat-step>
@@ -85,7 +85,7 @@
<mifosx-fixed-deposit-account-preview-step
[fixedDepositsAccountTemplate]="fixedDepositsAccountAndTemplate"
[fixedDepositsAccountProductTemplate]="fixedDepositsAccountProductTemplate"
[fixedDepositAccountData]="fixedDepositAccount" (submit)="submit()">
[fixedDepositAccountData]="fixedDepositAccount" (submitEvent)="submit()">
</mifosx-fixed-deposit-account-preview-step>
</mat-step>
@@ -352,7 +352,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>
@@ -40,7 +40,7 @@ export class FixedDepositAccountPreviewStepComponent implements OnChanges {
expandChartSlabIndex: number;
/** Form submission event */
@Output() submit = new EventEmitter();
@Output() submitEvent = new EventEmitter();
constructor() { }
@@ -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 {
fixedDepositsAccountData: any;
entityType: string;
@@ -28,7 +28,4 @@ export class GeneralTabComponent implements OnInit {
}
}
ngOnInit(): void {
}
}
@@ -84,7 +84,7 @@
<mifosx-recurring-deposits-account-preview-step
[recurringDepositsAccountTemplate]="recurringDepositsAccountTemplate"
[recurringDepositsAccountProductTemplate]="recurringDepositsAccountProductTemplate"
[recurringDepositAccountData]="recurringDepositAccountData" (submit)="submit()">
[recurringDepositAccountData]="recurringDepositAccountData" (submitEvent)="submit()">
</mifosx-recurring-deposits-account-preview-step>
</mat-step>
@@ -1,5 +1,5 @@
/** Angular Imports */
import { Component, OnInit, ViewChild } from '@angular/core';
import { Component, ViewChild } from '@angular/core';
import { ActivatedRoute, Router } from '@angular/router';
/** Custom Services */
@@ -21,7 +21,7 @@ import { Dates } from 'app/core/utils/dates';
templateUrl: './create-recurring-deposits-account.component.html',
styleUrls: ['./create-recurring-deposits-account.component.scss']
})
export class CreateRecurringDepositsAccountComponent implements OnInit {
export class CreateRecurringDepositsAccountComponent {
/** Imports all the step component */
@ViewChild(RecurringDepositsAccountDetailsStepComponent, { static: true }) recurringDepositsAccountDetailsStep: RecurringDepositsAccountDetailsStepComponent;
@@ -53,9 +53,6 @@ export class CreateRecurringDepositsAccountComponent implements OnInit {
this.recurringDepositsAccountProductTemplate = $event;
}
ngOnInit() {
}
/** Get Recurring Deposit Account Details Form Data */
get recurringDepositAccountDetailsForm() {
return this.recurringDepositsAccountDetailsStep.recurringDepositAccountDetailsForm;
@@ -84,7 +84,7 @@
<mifosx-recurring-deposits-account-preview-step
[recurringDepositsAccountTemplate]="recurringDepositsAccountAndTemplate"
[recurringDepositsAccountProductTemplate]="recurringDepositsAccountProductTemplate"
[recurringDepositAccountData]="recurringDepositAccountData" (submit)="submit()">
[recurringDepositAccountData]="recurringDepositAccountData" (submitEvent)="submit()">
</mifosx-recurring-deposits-account-preview-step>
</mat-step>
@@ -1,5 +1,5 @@
/** Angular Imports */
import { Component, OnInit, ViewChild } from '@angular/core';
import { Component, ViewChild } from '@angular/core';
import { ActivatedRoute, Router } from '@angular/router';
/** Custom Services */
@@ -21,7 +21,7 @@ import { Dates } from 'app/core/utils/dates';
templateUrl: './edit-recurring-deposit-account.component.html',
styleUrls: ['./edit-recurring-deposit-account.component.scss']
})
export class EditRecurringDepositAccountComponent implements OnInit {
export class EditRecurringDepositAccountComponent {
/** Imports all the step component */
@ViewChild(RecurringDepositsAccountDetailsStepComponent, { static: true }) recurringDepositsAccountDetailsStep: RecurringDepositsAccountDetailsStepComponent;
@@ -53,9 +53,6 @@ export class EditRecurringDepositAccountComponent implements OnInit {
this.recurringDepositsAccountProductTemplate = $event;
}
ngOnInit() {
}
/** Get Recurring Deposit Account Details Form Data */
get recurringDepositAccountDetailsForm() {
return this.recurringDepositsAccountDetailsStep.recurringDepositAccountDetailsForm;
@@ -352,7 +352,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>
@@ -24,7 +24,7 @@ export class RecurringDepositsAccountPreviewStepComponent implements OnChanges {
@Input() recurringDepositsAccountProductTemplate: any;
@Input() recurringDepositAccountData: any;
/** Output the submit action */
@Output() submit = new EventEmitter();
@Output() submitEvent = new EventEmitter();
/** Charges Displayed Columns */
chargesDisplayedColumns: string[] = ['name', 'chargeCalculationType', 'amount', 'chargeTimeType', 'date', 'repaymentsEvery'];
@@ -75,7 +75,7 @@
</button>
</span>
<span *ngIf="recurringDepositsAccountData.status.value !== 'Submitted and pending approval' && charge.amountOutstanding !== 0">
<span *ngIf="charge.chargeTimeType.value == 'Monthly Fee' || charge.chargeTimeType.value == 'Annual Fee'|| charge.chargeTimeType.value == 'Specified due date'">
<span *ngIf="charge.chargeTimeType.value === 'Monthly Fee' || charge.chargeTimeType.value === 'Annual Fee'|| charge.chargeTimeType.value === 'Specified due date'">
<button class="account-action-button" mat-raised-button color="primary" matTooltip="{{ 'tooltips.Pay Charge' | translate}}"
*mifosxHasPermission="'PAY_SAVINGSACCOUNTCHARGE'" (click)="routeEdit($event); payCharge(charge.id)">
<i class="fa fa-dollar"></i>
@@ -1,4 +1,4 @@
import { Component, OnInit, Inject } from '@angular/core';
import { Component, Inject } from '@angular/core';
import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog';
@Component({
@@ -6,7 +6,7 @@ import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog';
templateUrl: './recurring-deposit-confirmation-dialog.component.html',
styleUrls: ['./recurring-deposit-confirmation-dialog.component.scss']
})
export class RecurringDepositConfirmationDialogComponent implements OnInit {
export class RecurringDepositConfirmationDialogComponent {
/**
* @param {MatDialogRef} dialogRef Component reference to dialog.
@@ -15,7 +15,4 @@ export class RecurringDepositConfirmationDialogComponent implements OnInit {
constructor(public dialogRef: MatDialogRef<RecurringDepositConfirmationDialogComponent>,
@Inject(MAT_DIALOG_DATA) public data: any) { }
ngOnInit() {
}
}
@@ -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 {
recurringDepositsAccountData: any;
isprematureAllowed = false;
@@ -29,7 +29,5 @@ export class GeneralTabComponent implements OnInit {
}
});
}
ngOnInit(): void {
}
}
@@ -2,7 +2,7 @@
*ngIf="!(transactionData.reversed)">
<span *mifosxHasPermission="'ADJUSTTRANSACTION_SAVINGSACCOUNT'">
<button mat-raised-button color="primary"
*ngIf="!(transactionData.transactionType.value == 'Transfer' || transactionData.reversed == 'true')"
*ngIf="!(transactionData.transactionType.value === 'Transfer' || transactionData.reversed === 'true')"
[routerLink]="'edit'">
<fa-icon icon="edit" class="m-r-10"></fa-icon>{{"labels.buttons.Edit" | translate }}
</button>