Skip to content

Commit 74cd5ae

Browse files
committed
biome init
1 parent 12d8706 commit 74cd5ae

File tree

116 files changed

+3956
-4401
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

116 files changed

+3956
-4401
lines changed

app.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ onMounted(async () => {
5252
const gasPrice = await fetchGasPrice()
5353
appStore.gas = gasPrice
5454
55-
window.onbeforeunload = function () {
55+
window.onbeforeunload = () => {
5656
Socket.close()
5757
}
5858
})

assets/workers/worker.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import init, { run_worker } from "@/services/lumina-node-wasm/index.js"
22

33
async function worker_main() {
4-
let queued = []
4+
const queued = []
55
if (typeof SharedWorkerGlobalScope !== "undefined" && self instanceof SharedWorkerGlobalScope) {
66
onconnect = (event) => {
77
queued.push(event)

biome.json

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
{
2+
"$schema": "https://biomejs.dev/schemas/1.9.3/schema.json",
3+
"vcs": { "enabled": false, "clientKind": "git", "useIgnoreFile": false },
4+
"files": {
5+
"ignoreUnknown": false,
6+
"ignore": [
7+
".nuxt",
8+
".output",
9+
"node_modules/**",
10+
"dist/**",
11+
"services/utils/msgpayforblobs.js",
12+
"services/utils/blobtx.js",
13+
"services/utils/blob.js",
14+
"services/lumina-node-wasm",
15+
"services/proto/gen"
16+
]
17+
},
18+
"formatter": {
19+
"enabled": true,
20+
"useEditorconfig": true,
21+
"formatWithErrors": false,
22+
"indentStyle": "tab",
23+
"indentWidth": 4,
24+
"lineEnding": "lf",
25+
"lineWidth": 140,
26+
"attributePosition": "auto",
27+
"bracketSpacing": true
28+
},
29+
"organizeImports": { "enabled": false },
30+
"linter": {
31+
"enabled": true,
32+
"rules": {
33+
"recommended": true,
34+
"style": { "noParameterAssign": "off" },
35+
"performance": {
36+
"noDelete": "info"
37+
},
38+
"suspicious": { "noAsyncPromiseExecutor": "off", "noGlobalAssign": "off" },
39+
"complexity": { "noExtraBooleanCast": "off" }
40+
}
41+
},
42+
"javascript": {
43+
"formatter": {
44+
"jsxQuoteStyle": "double",
45+
"quoteProperties": "asNeeded",
46+
"trailingCommas": "all",
47+
"semicolons": "asNeeded",
48+
"arrowParentheses": "always",
49+
"bracketSameLine": false,
50+
"quoteStyle": "double",
51+
"attributePosition": "auto",
52+
"bracketSpacing": true
53+
}
54+
}
55+
}

components/AddressBadge.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,14 @@ const props = defineProps({
66
},
77
color: {
88
type: String,
9-
default: "primary"
9+
default: "primary",
1010
},
1111
})
1212
1313
const alias = computed(() => {
1414
const { $getDisplayName } = useNuxtApp()
1515
16-
return $getDisplayName('addresses', props.hash)
16+
return $getDisplayName("addresses", props.hash)
1717
})
1818
</script>
1919

components/AmountInCurrency.vue

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ const defaultCurrencyStyle = {
5050
}
5151
5252
const calculatedAmount = computed(() => {
53-
let finalAmount = {
53+
const finalAmount = {
5454
amount: {
5555
...defaultAmount,
5656
...props.amount,
@@ -74,12 +74,12 @@ const calculatedAmount = computed(() => {
7474
...defaultCurrencyStyle,
7575
...props.styles.currency,
7676
},
77-
}
77+
},
7878
}
7979
8080
let tiaDisplay
8181
let tiaExchange
82-
if (finalAmount.amount.unit === 'utia') {
82+
if (finalAmount.amount.unit === "utia") {
8383
tiaExchange = finalAmount.amount.value / 1_000_000
8484
8585
if (finalAmount.amount.currency === "TIA") {
@@ -92,7 +92,7 @@ const calculatedAmount = computed(() => {
9292
tiaExchange = finalAmount.amount.value
9393
}
9494
95-
let amountConverted = tiaExchange * (currentPrice.value?.close ? currentPrice.value.close : 0)
95+
const amountConverted = tiaExchange * (currentPrice.value?.close ? currentPrice.value.close : 0)
9696
9797
if (displayCurrency.value === "TIA") {
9898
finalAmount.display.show = {
@@ -124,7 +124,7 @@ const calculatedAmount = computed(() => {
124124
<Text
125125
:size="calculatedAmount.styles.amount.size"
126126
:weight="calculatedAmount.styles.amount.weight"
127-
:color="parseFloat(amount.value) ? calculatedAmount.styles.amount.color : 'tertiary'"
127+
:color="Number.parseFloat(amount.value) ? calculatedAmount.styles.amount.color : 'tertiary'"
128128
>
129129
{{ calculatedAmount.display.show.value }}
130130
</Text>
@@ -142,7 +142,7 @@ const calculatedAmount = computed(() => {
142142
<Text
143143
:size="calculatedAmount.styles.amount.size"
144144
:weight="calculatedAmount.styles.amount.weight"
145-
:color="parseFloat(amount.value) ? calculatedAmount.styles.amount.color : 'tertiary'"
145+
:color="Number.parseFloat(amount.value) ? calculatedAmount.styles.amount.color : 'tertiary'"
146146
>
147147
{{ calculatedAmount.display.tooltip.value }}
148148
</Text>

components/BookmarkButton.vue

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,7 @@ const bookmarkText = computed(() => {
3939
4040
const handleBookmark = () => {
4141
if (!isBookmarked.value) {
42-
43-
let newBookmark = {
42+
const newBookmark = {
4443
id: props.id,
4544
type: capitilize(props.type),
4645
ts: new Date().getTime(),
@@ -70,7 +69,6 @@ const handleBookmark = () => {
7069
cacheStore.current.bookmark = newBookmark
7170
modalsStore.open("edit_alias")
7271
}
73-
7472
} else {
7573
let notification = {}
7674
@@ -87,7 +85,7 @@ const handleBookmark = () => {
8785
notification = {
8886
type: "error",
8987
icon: "close",
90-
title: `Failed to remove the bookmark`,
88+
title: "Failed to remove the bookmark",
9189
autoDestroy: true,
9290
}
9391
}
@@ -99,9 +97,8 @@ const handleBookmark = () => {
9997
}
10098
10199
onMounted(() => {
102-
isBookmarked.value = bookmarksStore.getBookmark(props.type, props.id) ? true : false
100+
isBookmarked.value = !!bookmarksStore.getBookmark(props.type, props.id)
103101
})
104-
105102
</script>
106103

107104
<template>

components/Connection.vue

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ const { hostname } = useRequestURL()
3030
3131
switch (hostname) {
3232
case "celenium.io":
33-
// case "dev.celenium.io":
33+
// case "dev.celenium.io":
3434
appStore.network = mainnet
3535
break
3636
@@ -44,7 +44,6 @@ switch (hostname) {
4444
default:
4545
appStore.network = arabica
4646
break
47-
4847
}
4948
5049
const getBalance = async () => {
@@ -54,7 +53,7 @@ const getBalance = async () => {
5453
const { data } = await fetchAddressByHash(key.bech32Address)
5554
5655
if (data.value?.balance) {
57-
appStore.balance = parseFloat(data.value.balance.spendable / 1_000_000) || 0
56+
appStore.balance = Number.parseFloat(data.value.balance.spendable / 1_000_000) || 0
5857
}
5958
}
6059
}

components/DatePicker.vue

Lines changed: 39 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -9,88 +9,93 @@ import Popover from "@/components/ui/Popover.vue"
99
const props = defineProps({
1010
from: {
1111
type: String,
12-
default: '',
12+
default: "",
1313
},
1414
to: {
1515
type: String,
16-
default: '',
16+
default: "",
1717
},
1818
minDate: {
1919
type: String,
20-
default: '',
21-
}
20+
default: "",
21+
},
2222
})
2323
2424
const emit = defineEmits(["onUpdate"])
2525
2626
const currentDate = ref(DateTime.now())
27-
const limitMinDate = ref(props.minDate ? DateTime.fromISO(props.minDate) : '')
27+
const limitMinDate = ref(props.minDate ? DateTime.fromISO(props.minDate) : "")
2828
const month = ref(currentDate.value.month)
2929
const year = ref(currentDate.value.year)
30-
const startDate = ref(props.from ? DateTime.fromSeconds(parseInt(props.from)) : {})
31-
const endDate = ref(props.to ? DateTime.fromSeconds(parseInt(props.to)) : {})
32-
const weekdays = ref(Info.weekdays('narrow', { locale: 'en-US' }))
30+
const startDate = ref(props.from ? DateTime.fromSeconds(Number.parseInt(props.from)) : {})
31+
const endDate = ref(props.to ? DateTime.fromSeconds(Number.parseInt(props.to)) : {})
32+
const weekdays = ref(Info.weekdays("narrow", { locale: "en-US" }))
3333
const days = computed(() => {
34-
let rawDays = []
35-
const firstDay = DateTime.local(year.value, month.value).setLocale('en-US')
36-
const lastDay = firstDay.endOf('month')
34+
const rawDays = []
35+
const firstDay = DateTime.local(year.value, month.value).setLocale("en-US")
36+
const lastDay = firstDay.endOf("month")
3737
3838
for (let day = firstDay; day <= lastDay; day = day.plus({ days: 1 })) {
39-
rawDays.push(day)
40-
}
39+
rawDays.push(day)
40+
}
4141
4242
if (firstDay.weekday !== 1) {
4343
let prevDay = firstDay
4444
while (prevDay.weekday !== 1) {
45-
prevDay = prevDay.minus({ days: 1 }).startOf('day')
45+
prevDay = prevDay.minus({ days: 1 }).startOf("day")
4646
rawDays.unshift(prevDay)
4747
}
4848
}
4949
5050
if (lastDay.weekday !== 7) {
5151
let nextDay = lastDay
5252
while (nextDay.weekday !== 7) {
53-
nextDay = nextDay.plus({ days: 1 }).startOf('day')
53+
nextDay = nextDay.plus({ days: 1 }).startOf("day")
5454
rawDays.push(nextDay)
5555
}
5656
}
5757
58-
let resDays = []
58+
const resDays = []
5959
while (rawDays.length) {
6060
resDays.push(rawDays.splice(0, 7))
6161
}
6262
6363
return resDays
6464
})
6565
66-
const selectedRange = ref('')
66+
const selectedRange = ref("")
6767
const updateSelectedRange = (from, to) => {
6868
if (from?.ts) {
6969
if (to?.ts) {
7070
if (from.year === to.year) {
71-
selectedRange.value = from.toFormat('dd LLL') !== to.toFormat('dd LLL') ? `${from.toFormat('dd LLL')} - ${to.toFormat('dd LLL')}` : from.toFormat('dd LLL')
71+
selectedRange.value =
72+
from.toFormat("dd LLL") !== to.toFormat("dd LLL")
73+
? `${from.toFormat("dd LLL")} - ${to.toFormat("dd LLL")}`
74+
: from.toFormat("dd LLL")
7275
} else {
73-
selectedRange.value = `${from.toFormat('dd LLL yyyy')} - ${to.toFormat('dd LLL yyyy')}`
76+
selectedRange.value = `${from.toFormat("dd LLL yyyy")} - ${to.toFormat("dd LLL yyyy")}`
7477
}
7578
} else {
76-
selectedRange.value = from.toFormat('dd LLL')
79+
selectedRange.value = from.toFormat("dd LLL")
7780
}
7881
} else {
79-
selectedRange.value = ''
82+
selectedRange.value = ""
8083
}
8184
}
8285
updateSelectedRange(startDate.value, endDate.value)
8386
8487
const isNextMonthAvailable = computed(() => !(month.value === currentDate.value.month && year.value === currentDate.value.year))
85-
const isPrevMonthAvailable = computed(() => limitMinDate.value ? limitMinDate.value.ts < days.value[0][0].ts : true)
88+
const isPrevMonthAvailable = computed(() => (limitMinDate.value ? limitMinDate.value.ts < days.value[0][0].ts : true))
8689
const isDayAvailable = (d) => {
87-
if (d.startOf('day').ts > currentDate.value.startOf('day').ts) {
90+
if (d.startOf("day").ts > currentDate.value.startOf("day").ts) {
8891
return false
89-
} else if (limitMinDate.value) {
90-
return d.startOf('day').ts >= limitMinDate.value.startOf('day').ts
91-
} else {
92-
return true
9392
}
93+
94+
if (limitMinDate.value) {
95+
return d.startOf("day").ts >= limitMinDate.value.startOf("day").ts
96+
}
97+
98+
return true
9499
}
95100
96101
const handleSelectDate = (d) => {
@@ -131,18 +136,18 @@ const handleClose = () => {
131136
132137
if (!startDate.value.ts) {
133138
month.value = currentDate.value.month
134-
year.value = currentDate.value.year
139+
year.value = currentDate.value.year
135140
}
136141
}
137142
138143
const handleApply = () => {
139144
isOpen.value = false
140145
141146
if (!endDate.value.ts) {
142-
endDate.value = startDate.value.endOf('day')
147+
endDate.value = startDate.value.endOf("day")
143148
}
144149
145-
emit('onUpdate', { from: parseInt(startDate.value.ts / 1_000), to: parseInt(endDate.value.ts / 1_000) })
150+
emit("onUpdate", { from: Number.parseInt(startDate.value.ts / 1_000), to: Number.parseInt(endDate.value.ts / 1_000) })
146151
}
147152
148153
const handleClear = () => {
@@ -151,18 +156,18 @@ const handleClear = () => {
151156
startDate.value = {}
152157
endDate.value = {}
153158
154-
emit('onUpdate', { clear: true })
159+
emit("onUpdate", { clear: true })
155160
}
156161
157162
const handleMonthChange = (v) => {
158163
switch (month.value + v) {
159164
case 0:
160165
month.value = 12
161-
year.value --
166+
year.value--
162167
break
163168
case 13:
164169
month.value = 1
165-
year.value ++
170+
year.value++
166171
break
167172
default:
168173
month.value += v
@@ -172,7 +177,7 @@ const handleMonthChange = (v) => {
172177
watch(
173178
() => props.from,
174179
() => {
175-
updateSelectedRange(DateTime.fromSeconds(parseInt(props.from)), DateTime.fromSeconds(parseInt(props.to)))
180+
updateSelectedRange(DateTime.fromSeconds(Number.parseInt(props.from)), DateTime.fromSeconds(Number.parseInt(props.to)))
176181
},
177182
)
178183
</script>

0 commit comments

Comments
 (0)