Browse Source
Feature/Switch prefer-optional-chain eslint rule from warn to error (#3983)
* Switch prefer-optional-chain eslint rule from warn to error
* Update changelog
---------
Signed-off-by: Dominik Willner <th33xitus@gmail.com>
pull/3985/head
dw-0
3 months ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with
3 additions and
3 deletions
-
.eslintrc.json
-
CHANGELOG.md
-
apps/api/src/helper/object.helper.ts
-
libs/ui/src/lib/shared/abstract-mat-form-field.ts
|
|
@ -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" |
|
|
|
} |
|
|
|
|
|
@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 |
|
|
|
### Changed |
|
|
|
|
|
|
|
- Switched the `consistent-type-assertions` rule from `warn` to `error` in the `eslint` configuration |
|
|
|
- Switched the `prefer-optional-chain` rule from `warn` to `error` in the `eslint` configuration |
|
|
|
|
|
|
|
## 2.119.0 - 2024-10-26 |
|
|
|
|
|
|
|
|
|
@ -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; |
|
|
|
} |
|
|
|
|
|
|
|
|
|
@ -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; |
|
|
|
} |
|
|
|
|
|
|
|