Browse Source

fix: @typescript-eslint/prefer-optional-chain

Signed-off-by: Dominik Willner <th33xitus@gmail.com>
pull/3983/head
dw-0 10 months ago
parent
commit
5f7ca2a672
  1. 1
      .eslintrc.json
  2. 2
      apps/api/src/helper/object.helper.ts
  3. 2
      libs/ui/src/lib/shared/abstract-mat-form-field.ts

1
.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"
}

2
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;
}

2
libs/ui/src/lib/shared/abstract-mat-form-field.ts

@ -112,7 +112,7 @@ export abstract class AbstractMatFormField<T>
public _disabled: boolean = false;
public get disabled() {
if (this.ngControl && this.ngControl.disabled !== null) {
if (this.ngControl?.disabled !== null) {
return this.ngControl.disabled;
}

Loading…
Cancel
Save