chore(lint): enforce 2-space indent & add gpg pre-commit hook

This commit is contained in:
2026-03-04 02:45:53 +00:00
parent b98a14950c
commit 10286c2924
7 changed files with 135 additions and 118 deletions

View File

@@ -1,22 +1,22 @@
import QRCode from 'qrcode'
self.onmessage = async (e) => {
const { id, text, ecc } = e.data
const { id, text, ecc } = e.data
if (!text) {
self.postMessage({ id, svgContent: '' })
return
}
if (!text) {
self.postMessage({ id, svgContent: '' })
return
}
try {
const svgContent = await QRCode.toString(text, {
type: 'svg',
errorCorrectionLevel: ecc,
margin: 1,
})
try {
const svgContent = await QRCode.toString(text, {
type: 'svg',
errorCorrectionLevel: ecc,
margin: 1,
})
self.postMessage({ id, svgContent })
} catch (err) {
self.postMessage({ id, error: err.message })
}
self.postMessage({ id, svgContent })
} catch (err) {
self.postMessage({ id, error: err.message })
}
}