From e7d914395388df63bbddfdf4d8226afd4ba37260 Mon Sep 17 00:00:00 2001 From: Guillem Arias Date: Mon, 11 May 2026 19:34:53 +0200 Subject: [PATCH] chore(savings_goals/stepper): use Number.parseFloat / Number.NaN per Biome biome lint --write picked these up while auditing the chart changes. Pure rename, no behaviour change. --- .../controllers/savings_goal_stepper_controller.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/javascript/controllers/savings_goal_stepper_controller.js b/app/javascript/controllers/savings_goal_stepper_controller.js index a3d6bac2b..db6d5c20b 100644 --- a/app/javascript/controllers/savings_goal_stepper_controller.js +++ b/app/javascript/controllers/savings_goal_stepper_controller.js @@ -124,7 +124,7 @@ export default class extends Controller { } const amountInput = this.hasAmountInputTarget ? this.amountInputTarget : null; - const amountValue = amountInput ? parseFloat(amountInput.value) : NaN; + const amountValue = amountInput ? Number.parseFloat(amountInput.value) : Number.NaN; if (amountInput && (!Number.isFinite(amountValue) || amountValue <= 0)) { this.showFieldError(amountInput, this.hasAmountErrorTarget ? this.amountErrorTarget : null); firstInvalid ||= amountInput; @@ -234,7 +234,7 @@ export default class extends Controller { const name = this.element.querySelector('input[name="savings_goal[name]"]')?.value || "—"; const amountInput = this.element.querySelector('input[name="savings_goal[target_amount]"]'); - const amount = amountInput?.value ? parseFloat(amountInput.value) : 0; + const amount = amountInput?.value ? Number.parseFloat(amountInput.value) : 0; const dateInput = this.element.querySelector('input[type="date"][name="savings_goal[target_date]"]'); const dateValue = dateInput?.value; @@ -251,7 +251,7 @@ export default class extends Controller { if (this.hasReviewAccountsTarget) { const checked = this.linkedAccountCheckboxTargets.filter((cb) => cb.checked); const total = checked.reduce( - (sum, cb) => sum + parseFloat(cb.dataset.accountBalance || 0), + (sum, cb) => sum + Number.parseFloat(cb.dataset.accountBalance || 0), 0, ); this.reviewAccountsTarget.textContent = checked.length