Enable unicorn/prefer-number-coercion rule (#19374)

This commit is contained in:
fisker Cheung authored and GitHub committed 2026-06-16 04:26:09 +08:00
1 parent 81e5eac947
commit 7f1f8a7cd8
2 files changed
+3 -3

No files matched your search

+3 -2
View File
@@ -45,7 +45,6 @@ export function NumberInput(
{ label: _label, title, value, min, max, step },
{ emit },
) {
const onChange = (value) => emit("change", value);
return (
<label title={title}>
{_label}{" "}
@@ -55,7 +54,9 @@ export function NumberInput(
max={max}
step={step}
value={value}
onChange={(ev) => onChange(Number.parseInt(ev.target.value, 10))}
onChange={(ev) => {
emit("change", Number(ev.target.value));
}}
/>
</label>
);