Skip to content

Commit

Permalink
Update dependency prettier to v3.3.3 (#21408)
Browse files Browse the repository at this point in the history
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Simon Lamon <[email protected]>
  • Loading branch information
renovate[bot] and silamon authored Jul 16, 2024
1 parent 2a970b8 commit ef3758d
Show file tree
Hide file tree
Showing 16 changed files with 32 additions and 28 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@
"object-hash": "3.0.0",
"open": "10.1.0",
"pinst": "3.0.0",
"prettier": "3.3.2",
"prettier": "3.3.3",
"rollup": "2.79.1",
"rollup-plugin-string": "3.0.0",
"rollup-plugin-terser": "7.0.2",
Expand Down
6 changes: 4 additions & 2 deletions src/common/navigate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,9 @@ export const navigate = (path: string, options?: NavigateOptions) => {
if (__DEMO__) {
if (replace) {
mainWindow.history.replaceState(
mainWindow.history.state?.root ? { root: true } : options?.data ?? null,
mainWindow.history.state?.root
? { root: true }
: (options?.data ?? null),
"",
`${mainWindow.location.pathname}#${path}`
);
Expand All @@ -34,7 +36,7 @@ export const navigate = (path: string, options?: NavigateOptions) => {
}
} else if (replace) {
mainWindow.history.replaceState(
mainWindow.history.state?.root ? { root: true } : options?.data ?? null,
mainWindow.history.state?.root ? { root: true } : (options?.data ?? null),
"",
path
);
Expand Down
4 changes: 2 additions & 2 deletions src/components/chart/state-history-chart-timeline.ts
Original file line number Diff line number Diff line change
Expand Up @@ -159,10 +159,10 @@ export class StateHistoryChartTimeline extends LitElement {
},
afterUpdate: (y) => {
const yWidth = this.showNames
? y.width ?? 0
? (y.width ?? 0)
: computeRTL(this.hass)
? 0
: y.left ?? 0;
: (y.left ?? 0);
if (
this._yWidth !== Math.floor(yWidth) &&
y.ticks.length === this.data.length
Expand Down
3 changes: 2 additions & 1 deletion src/components/data-table/dialog-data-table-settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,8 @@ export class DialogDataTableSettings extends LitElement {
const canHide = !col.main && col.hideable !== false;
const isVisible = !(this._columnOrder &&
this._columnOrder.includes(col.key)
? this._hiddenColumns?.includes(col.key) ?? col.defaultHidden
? (this._hiddenColumns?.includes(col.key) ??
col.defaultHidden)
: col.defaultHidden);
return html`<ha-list-item
Expand Down
9 changes: 5 additions & 4 deletions src/components/data-table/ha-data-table.ts
Original file line number Diff line number Diff line change
Expand Up @@ -379,7 +379,8 @@ export class HaDataTable extends LitElement {
if (
column.hidden ||
(this.columnOrder && this.columnOrder.includes(key)
? this.hiddenColumns?.includes(key) ?? column.defaultHidden
? (this.hiddenColumns?.includes(key) ??
column.defaultHidden)
: column.defaultHidden)
) {
return nothing;
Expand Down Expand Up @@ -518,7 +519,7 @@ export class HaDataTable extends LitElement {
(narrow && !column.main && !column.showNarrow) ||
column.hidden ||
(this.columnOrder && this.columnOrder.includes(key)
? this.hiddenColumns?.includes(key) ?? column.defaultHidden
? (this.hiddenColumns?.includes(key) ?? column.defaultHidden)
: column.defaultHidden)
) {
return nothing;
Expand Down Expand Up @@ -560,8 +561,8 @@ export class HaDataTable extends LitElement {
!column2.showNarrow &&
!(this.columnOrder &&
this.columnOrder.includes(key2)
? this.hiddenColumns?.includes(key2) ??
column2.defaultHidden
? (this.hiddenColumns?.includes(key2) ??
column2.defaultHidden)
: column2.defaultHidden)
)
.map(
Expand Down
2 changes: 1 addition & 1 deletion src/components/entity/ha-state-label-badge.ts
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ export class HaStateLabelBadge extends LitElement {
this._timerTimeRemaining
)}
.description=${this.showName
? this.name ?? computeStateName(entityState)
? (this.name ?? computeStateName(entityState))
: undefined}
>
${!image && showIcon
Expand Down
4 changes: 2 additions & 2 deletions src/components/map/ha-map.ts
Original file line number Diff line number Diff line change
Expand Up @@ -483,12 +483,12 @@ export class HaMap extends ReactiveElement {
const entityName =
typeof entity !== "string" && entity.label_mode === "state"
? this.hass.formatEntityState(stateObj)
: customTitle ??
: (customTitle ??
title
.split(" ")
.map((part) => part[0])
.join("")
.substr(0, 3);
.substr(0, 3));

// create marker with the icon
const marker = Leaflet.marker([latitude, longitude], {
Expand Down
4 changes: 2 additions & 2 deletions src/data/cover.ts
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,8 @@ export function computeCoverPositionStateDisplay(
position?: number
) {
const statePosition = stateActive(stateObj)
? stateObj.attributes.current_position ??
stateObj.attributes.current_tilt_position
? (stateObj.attributes.current_position ??
stateObj.attributes.current_tilt_position)
: undefined;

const currentPosition = position ?? statePosition;
Expand Down
2 changes: 1 addition & 1 deletion src/fake_data/provide_hass.ts
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,7 @@ export const provideHass = (
(state !== null ? state : stateObj.state) ?? "",
formatEntityAttributeName: (_stateObj, attribute) => attribute,
formatEntityAttributeValue: (stateObj, attribute, value) =>
value !== null ? value : stateObj.attributes[attribute] ?? "",
value !== null ? value : (stateObj.attributes[attribute] ?? ""),
...overrideData,
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ class HuiCoverPositionCardFeature
}

const percentage = stateActive(this.stateObj)
? this.stateObj.attributes.current_position ?? 0
? (this.stateObj.attributes.current_position ?? 0)
: 0;

const value = Math.max(Math.round(percentage), 0);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ class HuiFanSpeedCardFeature extends LitElement implements LovelaceCardFeature {
const speedCount = computeFanSpeedCount(this.stateObj);

const percentage = stateActive(this.stateObj)
? this.stateObj.attributes.percentage ?? 0
? (this.stateObj.attributes.percentage ?? 0)
: 0;

if (speedCount <= FAN_SPEED_COUNT_MAX_FOR_BUTTONS) {
Expand Down
2 changes: 1 addition & 1 deletion src/panels/lovelace/components/hui-generic-entity-row.ts
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ export class HuiGenericEntityRow extends LitElement {
: ""}
</div>`
: nothing}
${this.catchInteraction ?? !DOMAINS_INPUT_ROW.includes(domain)
${(this.catchInteraction ?? !DOMAINS_INPUT_ROW.includes(domain))
? html`<div
class="text-content value ${classMap({
pointer,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,8 +127,8 @@ export class HaCardConditionState extends LitElement {
const condition: StateCondition = {
condition: "state",
...content,
state: invert === "false" ? state ?? "" : undefined,
state_not: invert === "true" ? state ?? "" : undefined,
state: invert === "false" ? (state ?? "") : undefined,
state_not: invert === "true" ? (state ?? "") : undefined,
};

fireEvent(this, "value-changed", { value: condition });
Expand Down
2 changes: 1 addition & 1 deletion src/state-control/fan/ha-state-control-fan-speed.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export class HaStateControlFanSpeed extends LitElement {
protected updated(changedProp: Map<string | number | symbol, unknown>): void {
if (changedProp.has("stateObj")) {
const percentage = stateActive(this.stateObj)
? this.stateObj.attributes.percentage ?? 0
? (this.stateObj.attributes.percentage ?? 0)
: 0;
this.sliderValue = Math.max(Math.round(percentage), 0);
this.speedValue = fanPercentageToSpeed(this.stateObj, percentage);
Expand Down
2 changes: 1 addition & 1 deletion src/state/connection-mixin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ export const connectionMixin = <T extends Constructor<HassBaseEl>>(
(state != null ? state : stateObj.state) ?? "",
formatEntityAttributeName: (_stateObj, attribute) => attribute,
formatEntityAttributeValue: (stateObj, attribute, value) =>
value != null ? value : stateObj.attributes[attribute] ?? "",
value != null ? value : (stateObj.attributes[attribute] ?? ""),
...getState(),
...this._pendingHass,
};
Expand Down
10 changes: 5 additions & 5 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -9074,7 +9074,7 @@ __metadata:
object-hash: "npm:3.0.0"
open: "npm:10.1.0"
pinst: "npm:3.0.0"
prettier: "npm:3.3.2"
prettier: "npm:3.3.3"
proxy-polyfill: "npm:0.3.2"
punycode: "npm:2.3.1"
qr-scanner: "npm:1.4.2"
Expand Down Expand Up @@ -12153,12 +12153,12 @@ __metadata:
languageName: node
linkType: hard

"prettier@npm:3.3.2":
version: 3.3.2
resolution: "prettier@npm:3.3.2"
"prettier@npm:3.3.3":
version: 3.3.3
resolution: "prettier@npm:3.3.3"
bin:
prettier: bin/prettier.cjs
checksum: 10/83214e154afa5aa9b664c2506640212323eb1376b13379b2413dc351b7de0687629dca3f00ff2ec895ebd7e3a2adb7d7e231b6c77606e2358137f2150807405b
checksum: 10/5beac1f30b5b40162532b8e2f7c3a4eb650910a2695e9c8512a62ffdc09dae93190c29db9107fa7f26d1b6c71aad3628ecb9b5de1ecb0911191099be109434d7
languageName: node
linkType: hard

Expand Down

0 comments on commit ef3758d

Please sign in to comment.