From 5f7ca2a6724dd5bd853ab3e00564c39e1d302308 Mon Sep 17 00:00:00 2001 From: dw-0 Date: Thu, 24 Oct 2024 19:11:40 +0200 Subject: [PATCH] fix: @typescript-eslint/prefer-optional-chain Signed-off-by: Dominik Willner --- .eslintrc.json | 1 - apps/api/src/helper/object.helper.ts | 2 +- libs/ui/src/lib/shared/abstract-mat-form-field.ts | 2 +- 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/.eslintrc.json b/.eslintrc.json index 41157718c..259b0a9c9 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -143,7 +143,6 @@ // The following rules are part of @typescript-eslint/stylistic-type-checked // and can be remove once solved "@typescript-eslint/prefer-nullish-coalescing": "warn", // TODO: Requires strictNullChecks: true - "@typescript-eslint/prefer-optional-chain": "warn", "@typescript-eslint/consistent-indexed-object-style": "warn", "@typescript-eslint/consistent-generic-constructors": "warn" } diff --git a/apps/api/src/helper/object.helper.ts b/apps/api/src/helper/object.helper.ts index c6d825598..a5854e9d9 100644 --- a/apps/api/src/helper/object.helper.ts +++ b/apps/api/src/helper/object.helper.ts @@ -40,7 +40,7 @@ export function redactAttributes({ object: any; options: { attribute: string; valueMap: { [key: string]: any } }[]; }): any { - if (!object || !options || !options.length) { + if (!object || !options?.length) { return object; } diff --git a/libs/ui/src/lib/shared/abstract-mat-form-field.ts b/libs/ui/src/lib/shared/abstract-mat-form-field.ts index 05491b8ab..8c2d19fca 100644 --- a/libs/ui/src/lib/shared/abstract-mat-form-field.ts +++ b/libs/ui/src/lib/shared/abstract-mat-form-field.ts @@ -112,7 +112,7 @@ export abstract class AbstractMatFormField public _disabled: boolean = false; public get disabled() { - if (this.ngControl && this.ngControl.disabled !== null) { + if (this.ngControl?.disabled !== null) { return this.ngControl.disabled; }