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:
tanshu committed 2020-10-01 21:28:12 +05:30
1 parent 40e79ff949
commit 1350870f9e
545 files changed
+8455 -7036

No files matched your search

@@ -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-payment-dialog',
templateUrl: './payment-dialog.component.html',
styleUrls: ['./payment-dialog.component.css']
styleUrls: ['./payment-dialog.component.css'],
})
export class PaymentDialogComponent implements OnInit {
accounts: Observable<Account[]>;
@@ -22,7 +22,8 @@ export class PaymentDialogComponent implements OnInit {
public dialogRef: MatDialogRef<PaymentDialogComponent>,
@Inject(MAT_DIALOG_DATA) public data: any,
private fb: FormBuilder,
private accountSer: AccountService) {
private accountSer: AccountService,
) {
this.createForm();
this.setupAccountAutocomplete();
}
@@ -30,7 +31,7 @@ export class PaymentDialogComponent implements OnInit {
ngOnInit() {
this.form.setValue({
account: this.data.journal.account,
amount: this.data.journal.amount
amount: this.data.journal.amount,
});
this.account = this.data.journal.account;
}
@@ -38,22 +39,20 @@ export class PaymentDialogComponent implements OnInit {
createForm() {
this.form = this.fb.group({
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 {