diff --git a/app.vue b/app.vue index 1585cfab..a5c91fdc 100644 --- a/app.vue +++ b/app.vue @@ -52,7 +52,7 @@ onMounted(async () => { const gasPrice = await fetchGasPrice() appStore.gas = gasPrice - window.onbeforeunload = function () { + window.onbeforeunload = () => { Socket.close() } }) diff --git a/assets/workers/worker.js b/assets/workers/worker.js index 78b946f9..c6b20522 100644 --- a/assets/workers/worker.js +++ b/assets/workers/worker.js @@ -1,7 +1,7 @@ import init, { run_worker } from "@/services/lumina-node-wasm/index.js" async function worker_main() { - let queued = [] + const queued = [] if (typeof SharedWorkerGlobalScope !== "undefined" && self instanceof SharedWorkerGlobalScope) { onconnect = (event) => { queued.push(event) diff --git a/biome.json b/biome.json new file mode 100644 index 00000000..e0146ca8 --- /dev/null +++ b/biome.json @@ -0,0 +1,55 @@ +{ + "$schema": "https://biomejs.dev/schemas/1.9.3/schema.json", + "vcs": { "enabled": false, "clientKind": "git", "useIgnoreFile": false }, + "files": { + "ignoreUnknown": false, + "ignore": [ + ".nuxt", + ".output", + "node_modules/**", + "dist/**", + "services/utils/msgpayforblobs.js", + "services/utils/blobtx.js", + "services/utils/blob.js", + "services/lumina-node-wasm", + "services/proto/gen" + ] + }, + "formatter": { + "enabled": true, + "useEditorconfig": true, + "formatWithErrors": false, + "indentStyle": "tab", + "indentWidth": 4, + "lineEnding": "lf", + "lineWidth": 140, + "attributePosition": "auto", + "bracketSpacing": true + }, + "organizeImports": { "enabled": false }, + "linter": { + "enabled": true, + "rules": { + "recommended": true, + "style": { "noParameterAssign": "off" }, + "performance": { + "noDelete": "info" + }, + "suspicious": { "noAsyncPromiseExecutor": "off", "noGlobalAssign": "off" }, + "complexity": { "noExtraBooleanCast": "off" } + } + }, + "javascript": { + "formatter": { + "jsxQuoteStyle": "double", + "quoteProperties": "asNeeded", + "trailingCommas": "all", + "semicolons": "asNeeded", + "arrowParentheses": "always", + "bracketSameLine": false, + "quoteStyle": "double", + "attributePosition": "auto", + "bracketSpacing": true + } + } +} diff --git a/components/AddressBadge.vue b/components/AddressBadge.vue index b32a4a17..28b3404e 100644 --- a/components/AddressBadge.vue +++ b/components/AddressBadge.vue @@ -6,14 +6,14 @@ const props = defineProps({ }, color: { type: String, - default: "primary" + default: "primary", }, }) const alias = computed(() => { const { $getDisplayName } = useNuxtApp() - return $getDisplayName('addresses', props.hash) + return $getDisplayName("addresses", props.hash) }) diff --git a/components/AmountInCurrency.vue b/components/AmountInCurrency.vue index 96157464..060634b7 100644 --- a/components/AmountInCurrency.vue +++ b/components/AmountInCurrency.vue @@ -50,7 +50,7 @@ const defaultCurrencyStyle = { } const calculatedAmount = computed(() => { - let finalAmount = { + const finalAmount = { amount: { ...defaultAmount, ...props.amount, @@ -74,12 +74,12 @@ const calculatedAmount = computed(() => { ...defaultCurrencyStyle, ...props.styles.currency, }, - } + }, } let tiaDisplay let tiaExchange - if (finalAmount.amount.unit === 'utia') { + if (finalAmount.amount.unit === "utia") { tiaExchange = finalAmount.amount.value / 1_000_000 if (finalAmount.amount.currency === "TIA") { @@ -92,7 +92,7 @@ const calculatedAmount = computed(() => { tiaExchange = finalAmount.amount.value } - let amountConverted = tiaExchange * (currentPrice.value?.close ? currentPrice.value.close : 0) + const amountConverted = tiaExchange * (currentPrice.value?.close ? currentPrice.value.close : 0) if (displayCurrency.value === "TIA") { finalAmount.display.show = { @@ -124,7 +124,7 @@ const calculatedAmount = computed(() => { {{ calculatedAmount.display.show.value }} @@ -142,7 +142,7 @@ const calculatedAmount = computed(() => { {{ calculatedAmount.display.tooltip.value }} diff --git a/components/BookmarkButton.vue b/components/BookmarkButton.vue index 12cf1f54..93bcaddb 100644 --- a/components/BookmarkButton.vue +++ b/components/BookmarkButton.vue @@ -39,8 +39,7 @@ const bookmarkText = computed(() => { const handleBookmark = () => { if (!isBookmarked.value) { - - let newBookmark = { + const newBookmark = { id: props.id, type: capitilize(props.type), ts: new Date().getTime(), @@ -70,7 +69,6 @@ const handleBookmark = () => { cacheStore.current.bookmark = newBookmark modalsStore.open("edit_alias") } - } else { let notification = {} @@ -87,7 +85,7 @@ const handleBookmark = () => { notification = { type: "error", icon: "close", - title: `Failed to remove the bookmark`, + title: "Failed to remove the bookmark", autoDestroy: true, } } @@ -99,9 +97,8 @@ const handleBookmark = () => { } onMounted(() => { - isBookmarked.value = bookmarksStore.getBookmark(props.type, props.id) ? true : false + isBookmarked.value = !!bookmarksStore.getBookmark(props.type, props.id) }) -