Switched on the @typescript-eslint/no-non-null-assertion rule in eslint.
Fixed the errors it threw up.
This commit is contained in:
1 parent
c76696e022
commit
9f70ec2917
29 files changed
+144
-111
No files matched your search
@@ -44,10 +44,10 @@ export class SettingsComponent implements OnInit {
|
||||
}>;
|
||||
|
||||
lockInformation: LockInfo[];
|
||||
lockOlder: boolean = false;
|
||||
olderRolling: boolean = false;
|
||||
lockNewer: boolean = false;
|
||||
newerRolling: boolean = false;
|
||||
lockOlder = false;
|
||||
olderRolling = false;
|
||||
lockNewer = false;
|
||||
newerRolling = false;
|
||||
|
||||
rebaseDataForm: FormGroup<{
|
||||
date: FormControl<moment.Moment>;
|
||||
@@ -149,15 +149,15 @@ export class SettingsComponent implements OnInit {
|
||||
saveLock() {
|
||||
const item = new LockInfo();
|
||||
if (this.lockOlder && this.olderRolling) {
|
||||
item.start.days = +this.lockInfoForm.value.olderDays!;
|
||||
item.start.days = this.lockInfoForm.value.olderDays ?? 0;
|
||||
} else if (this.lockOlder && !this.olderRolling) {
|
||||
item.start.date = this.lockInfoForm.value.olderDate!.format('DD-MMM-YYYY');
|
||||
item.start.date = (this.lockInfoForm.value.olderDate ?? moment()).format('DD-MMM-YYYY');
|
||||
}
|
||||
if (this.lockNewer && this.newerRolling) {
|
||||
item.finish.days = +this.lockInfoForm.value.newerDays!;
|
||||
item.finish.days = this.lockInfoForm.value.newerDays ?? 0;
|
||||
}
|
||||
if (this.lockNewer && !this.newerRolling) {
|
||||
item.finish.date = this.lockInfoForm.value.newerDate!.format('DD-MMM-YYYY');
|
||||
item.finish.date = (this.lockInfoForm.value.newerDate ?? moment()).format('DD-MMM-YYYY');
|
||||
}
|
||||
const atArray = this.lockInfoForm.controls.accountTypes;
|
||||
this.accountTypes.forEach((at, index) => {
|
||||
@@ -182,7 +182,7 @@ export class SettingsComponent implements OnInit {
|
||||
if (validTill) {
|
||||
item.validTill = moment(validTill).format('DD-MMM-YYYY');
|
||||
}
|
||||
item.index = +this.lockInfoForm.value.index!;
|
||||
item.index = this.lockInfoForm.value.index ?? 0;
|
||||
|
||||
this.ser.setLockInformation(item).subscribe(
|
||||
(result) => {
|
||||
@@ -202,7 +202,7 @@ export class SettingsComponent implements OnInit {
|
||||
}
|
||||
|
||||
confirmRebase(): void {
|
||||
const rebaseDate = this.rebaseDataForm.value.date!.format('DD-MMM-YYYY');
|
||||
const rebaseDate = (this.rebaseDataForm.value.date ?? moment()).format('DD-MMM-YYYY');
|
||||
const dialogRef = this.dialog.open(ConfirmDialogComponent, {
|
||||
width: '250px',
|
||||
data: {
|
||||
|
||||
Reference in new issue
Block a user