ESLint: fix no-extra-boolean-cast violations

This commit is contained in:
Yury Bondarenko
2023-05-08 17:09:13 +02:00
parent ad4205073c
commit 6f0c1e003d
7 changed files with 10 additions and 10 deletions

View File

@@ -17,7 +17,7 @@ export class ValidateEmailNotTaken {
.pipe(
getFirstSucceededRemoteData(),
map(res => {
return !!res.payload ? { emailTaken: true } : null;
return res.payload ? { emailTaken: true } : null;
})
);
};

View File

@@ -207,7 +207,7 @@ export class GroupFormComponent implements OnInit, OnDestroy {
];
this.formGroup = this.formBuilderService.createFormGroup(this.formModel);
if (!!this.formGroup.controls.groupName) {
if (this.formGroup.controls.groupName) {
this.formGroup.controls.groupName.setAsyncValidators(ValidateGroupExists.createValidator(this.groupDataService));
this.groupNameValueChangeSubscribe = this.groupName.valueChanges.pipe(debounceTime(300)).subscribe(() => {
this.changeDetectorRef.detectChanges();

View File

@@ -51,7 +51,7 @@ export class FeedbackFormComponent implements OnInit {
ngOnInit() {
this.authService.getAuthenticatedUserFromStore().pipe(take(1)).subscribe((user: EPerson) => {
if (!!user) {
if (user) {
this.feedbackForm.patchValue({ email: user.email });
}
});

View File

@@ -170,7 +170,7 @@ export class DsDynamicLookupRelationModalComponent implements OnInit, OnDestroy
}
ngOnInit(): void {
if (!!this.currentItemIsLeftItem$) {
if (this.currentItemIsLeftItem$) {
this.currentItemIsLeftItem$.subscribe((isLeft) => {
this.isLeft = isLeft;
});

View File

@@ -123,7 +123,7 @@ export class FormComponent implements OnDestroy, OnInit {
}*/
private getFormGroup(): UntypedFormGroup {
if (!!this.parentFormModel) {
if (this.parentFormModel) {
return this.formGroup.parent as UntypedFormGroup;
}
@@ -183,7 +183,7 @@ export class FormComponent implements OnDestroy, OnInit {
const { fieldId } = error;
const { fieldIndex } = error;
let field: AbstractControl;
if (!!this.parentFormModel) {
if (this.parentFormModel) {
field = this.formBuilderService.getFormControlById(fieldId, formGroup.parent as UntypedFormGroup, formModel, fieldIndex);
} else {
field = this.formBuilderService.getFormControlById(fieldId, formGroup, formModel, fieldIndex);
@@ -206,7 +206,7 @@ export class FormComponent implements OnDestroy, OnInit {
const { fieldId } = error;
const { fieldIndex } = error;
let field: AbstractControl;
if (!!this.parentFormModel) {
if (this.parentFormModel) {
field = this.formBuilderService.getFormControlById(fieldId, formGroup.parent as UntypedFormGroup, formModel, fieldIndex);
} else {
field = this.formBuilderService.getFormControlById(fieldId, formGroup, formModel, fieldIndex);

View File

@@ -49,7 +49,7 @@ export class BrowseEntryListElementComponent extends AbstractListableElementComp
map((currentPage) => {
return {
value: this.object.value,
authority: !!this.object.authority ? this.object.authority : undefined,
authority: this.object.authority ? this.object.authority : undefined,
startsWith: undefined,
[pageParamName]: null,
[BBM_PAGINATION_ID + '.return']: currentPage

View File

@@ -188,7 +188,7 @@ export class SubmissionSectionCcLicensesComponent extends SectionModelComponent
*/
getCcLicenseLink$(): Observable<string> {
if (!!this.storedCcLicenseLink) {
if (this.storedCcLicenseLink) {
return observableOf(this.storedCcLicenseLink);
}
if (!this.getSelectedCcLicense() || this.getSelectedCcLicense().fields.some(
@@ -257,7 +257,7 @@ export class SubmissionSectionCcLicensesComponent extends SectionModelComponent
).subscribe((link) => {
this.operationsBuilder.add(path, link.toString(), false, true);
});
} else if (!!this.data.uri) {
} else if (this.data.uri) {
this.operationsBuilder.remove(path);
}
}