Fix unsafe optional chaining (#15604)

This commit is contained in:
Steve Repsher 2023-02-27 04:11:44 -05:00 committed by GitHub
parent d4ace99de3
commit 7568ae5964
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 2 additions and 3 deletions

View File

@ -59,7 +59,6 @@
"prefer-destructuring": "off",
"no-restricted-globals": [2, "event"],
"prefer-promise-reject-errors": "off",
"no-unsafe-optional-chaining": "warn",
"import/prefer-default-export": "off",
"import/no-default-export": "off",
"import/no-unresolved": "off",

View File

@ -72,7 +72,7 @@ class DialogZHAReconfigureDevice extends LitElement {
this.hass,
this.hass.localize(`ui.dialogs.zha_reconfigure_device.heading`) +
": " +
(this._params?.device.user_given_name || this._params?.device.name)
(this._params.device.user_given_name || this._params.device.name)
)}
>
${!this._status

View File

@ -183,7 +183,7 @@ class HuiGaugeCard extends LitElement implements LovelaceCard {
// new format
let segments = this._config!.segments;
if (segments) {
segments = [...segments].sort((a, b) => a?.from - b?.from);
segments = [...segments].sort((a, b) => a.from - b.from);
for (let i = 0; i < segments.length; i++) {
const segment = segments[i];