chore: lint and fmt

This commit is contained in:
Julien Calixte
2026-03-28 09:38:55 +01:00
parent 8e8706e258
commit 5f48aa5690
108 changed files with 726 additions and 680 deletions

View File

@@ -1,18 +1,18 @@
import { watch } from 'vue'
import { watch } from "vue"
import { backlinkEventBus } from '@/bus/backlinkEventBus'
import { data } from '@/data/data'
import { DataType } from '@/data/DataType.enum'
import { useFile } from '@/hooks/useFile.hook'
import { Backlink } from '@/modules/note/models/Backlink'
import { BacklinkNote } from '@/modules/note/models/BacklinkNote'
import { resolvePath } from '@/modules/repo/services/resolvePath'
import { useUserRepoStore } from '@/modules/repo/store/userRepo.store'
import { isExternalLink } from '@/utils/link'
import { filenameToNoteTitle } from '@/utils/noteTitle'
import { confirmMessage } from '@/utils/notif'
import { backlinkEventBus } from "@/bus/backlinkEventBus"
import { data } from "@/data/data"
import { DataType } from "@/data/DataType.enum"
import { useFile } from "@/hooks/useFile.hook"
import { Backlink } from "@/modules/note/models/Backlink"
import { BacklinkNote } from "@/modules/note/models/BacklinkNote"
import { resolvePath } from "@/modules/repo/services/resolvePath"
import { useUserRepoStore } from "@/modules/repo/store/userRepo.store"
import { isExternalLink } from "@/utils/link"
import { filenameToNoteTitle } from "@/utils/noteTitle"
import { confirmMessage } from "@/utils/notif"
const isMarkdown = (filename?: string) => filename?.endsWith('.md') ?? false
const isMarkdown = (filename?: string) => filename?.endsWith(".md") ?? false
export const useComputeBacklinks = () => {
const store = useUserRepoStore()
@@ -51,18 +51,18 @@ export const useComputeBacklinks = () => {
}
const parser = new DOMParser()
const htmlDoc = parser.parseFromString(note, 'text/html')
const htmlDoc = parser.parseFromString(note, "text/html")
const links = htmlDoc.querySelectorAll('a')
const links = htmlDoc.querySelectorAll("a")
for (const link of links) {
const href = link.getAttribute('href') ?? ''
const href = link.getAttribute("href") ?? ""
if (isExternalLink(href) || !isMarkdown(href)) {
continue
}
const path = resolvePath(file.path ?? '', href)
const path = resolvePath(file.path ?? "", href)
const backlinkFile = store.files.find((file) => file.path === path)
if (!backlinkFile?.sha || !backlinkFile?.path) {
@@ -77,14 +77,14 @@ export const useComputeBacklinks = () => {
if (!notifiedForComputation) {
notifiedForComputation = true
confirmMessage('Updating backlinks...')
confirmMessage("Updating backlinks...")
}
backlinks.set(backlinkFile.sha, [
...previousBacklinks,
{
sha: file.sha,
title: filenameToNoteTitle(file.path ?? '')
title: filenameToNoteTitle(file.path ?? "")
}
])
}