Fix eslint warnings

This commit is contained in:
Joscha 2025-02-10 15:42:21 +01:00
parent fba72e723f
commit 7b10670a88
6 changed files with 19 additions and 10 deletions

View file

@ -41,7 +41,9 @@ function createSomeNotes() {
.map(({ it }) => it);
}
onMounted(() => createSomeNotes());
onMounted(() => {
createSomeNotes();
});
</script>
<template>

View file

@ -19,7 +19,7 @@ const { floatingStyles } = useFloating(reference, floating, {
offset(4),
size({
apply({ availableHeight, elements }) {
elements.floating.style.maxHeight = `${Math.max(100, availableHeight)}px`;
elements.floating.style.maxHeight = `${Math.max(100, availableHeight).toFixed()}px`;
},
}),
],

View file

@ -41,7 +41,7 @@ const children = computed(() => {
const seen = new Map<string, number>();
const children = [];
for (const id of note.value.children) {
const iteration = seen.get(id) || 0;
const iteration = seen.get(id) ?? 0;
seen.set(id, iteration + 1);
children.push(new Segment(id, iteration));
}

View file

@ -13,7 +13,7 @@ const emit = defineEmits<{
}>();
const textarea = useTemplateRef<HTMLTextAreaElement>("textarea");
const text = ref(props.initialText || "");
const text = ref(props.initialText ?? "");
onMounted(() => {
textarea.value?.focus();
@ -23,7 +23,7 @@ onMounted(() => {
function updateTextareaHeight() {
if (!textarea.value) return;
textarea.value.style.height = "0px";
textarea.value.style.height = `${textarea.value.scrollHeight}px`;
textarea.value.style.height = `${textarea.value.scrollHeight.toFixed()}px`;
}
function onInput() {