Moved from tslint to eslint as tslint was depreciated.

Added prettier and also prettied all the typescript files using prettier

ESLint is using the AirBnB rules which are the most strict to lint the files.
This commit is contained in:
2020-10-01 21:28:12 +05:30
parent 40e79ff949
commit 1350870f9e
545 changed files with 8455 additions and 7036 deletions
@@ -1,16 +1,16 @@
import {Component, Inject, OnInit} from '@angular/core';
import { Component, Inject, OnInit } from '@angular/core';
import { MatAutocompleteSelectedEvent } from '@angular/material/autocomplete';
import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog';
import {debounceTime, distinctUntilChanged, map, startWith, switchMap} from 'rxjs/operators';
import {Account} from '../core/account';
import {AccountService} from '../core/account.service';
import {FormBuilder, FormGroup} from '@angular/forms';
import {Observable, of as observableOf} from 'rxjs';
import { debounceTime, distinctUntilChanged, map, startWith, switchMap } from 'rxjs/operators';
import { Account } from '../core/account';
import { AccountService } from '../core/account.service';
import { FormBuilder, FormGroup } from '@angular/forms';
import { Observable, of as observableOf } from 'rxjs';
@Component({
selector: 'app-journal-dialog',
templateUrl: './journal-dialog.component.html',
styleUrls: ['./journal-dialog.component.css']
styleUrls: ['./journal-dialog.component.css'],
})
export class JournalDialogComponent implements OnInit {
accounts: Observable<Account[]>;
@@ -22,7 +22,8 @@ export class JournalDialogComponent implements OnInit {
public dialogRef: MatDialogRef<JournalDialogComponent>,
@Inject(MAT_DIALOG_DATA) public data: any,
private fb: FormBuilder,
private accountSer: AccountService) {
private accountSer: AccountService,
) {
this.createForm();
this.setupAccountAutocomplete();
}
@@ -31,7 +32,7 @@ export class JournalDialogComponent implements OnInit {
this.form.setValue({
debit: '' + this.data.journal.debit,
account: this.data.journal.account,
amount: this.data.journal.amount
amount: this.data.journal.amount,
});
this.account = this.data.journal.account;
}
@@ -40,22 +41,20 @@ export class JournalDialogComponent implements OnInit {
this.form = this.fb.group({
debit: '1',
account: '',
amount: ''
amount: '',
});
this.accBal = null;
}
setupAccountAutocomplete(): void {
const control = this.form.get('account');
this.accounts = control.valueChanges
.pipe(
startWith(null),
map(x => (x !== null && x.length >= 1) ? x : null),
debounceTime(150),
distinctUntilChanged(),
switchMap(x => (x === null) ? observableOf([]) : this.accountSer.autocomplete(x))
);
this.accounts = control.valueChanges.pipe(
startWith(null),
map((x) => (x !== null && x.length >= 1 ? x : null)),
debounceTime(150),
distinctUntilChanged(),
switchMap((x) => (x === null ? observableOf([]) : this.accountSer.autocomplete(x))),
);
}
displayAccount(account?: Account): string | undefined {