feat: apply eslint fixes

This commit is contained in:
Yarmo Mackenbach 2024-06-21 16:18:54 +02:00
parent fc50fd56a9
commit 60cb02f9dd
No known key found for this signature in database
GPG key ID: C248C28D432560ED
5 changed files with 13 additions and 7 deletions

View file

@ -65,7 +65,7 @@ const doVerification = async (profile) => {
const claim = user.claims[iClaim]
promises.push(
new Promise((resolve, reject) => {
new Promise((resolve) => {
(async () => {
await claim.verify(verificationOptions)
results.push([iUser, iClaim, claim])

View file

@ -49,13 +49,19 @@ let gitBranch = process.env.CI_COMMIT_BRANCH ?? process.env.COMMIT_BRANCH
if (!gitBranch) {
try {
gitBranch = execSync('git rev-parse --abbrev-ref HEAD').toString().trim()
} catch (_) {}
} catch (_err) {
logger.debug('Could not get git branch',
{ component: 'http_server', action: 'init' })
}
}
let gitHash = process.env.CI_COMMIT_SHA ?? process.env.COMMIT_SHA
if (!gitHash) {
try {
gitHash = execSync('git rev-parse HEAD').toString().trim()
} catch (_) {}
} catch (_err) {
logger.debug('Could not get git hash',
{ component: 'http_server', action: 'init' })
}
}
const app = express()

View file

@ -32,7 +32,7 @@ import * as httpContext from 'express-http-context2'
import * as dotenv from 'dotenv'
dotenv.config()
const anonymize = format((info, opts) => {
const anonymize = format((info) => {
if (process.env.NODE_ENV !== 'development') {
info.profile_id = undefined
info.keyserver_domain = undefined
@ -44,7 +44,7 @@ const anonymize = format((info, opts) => {
return info
})
const addRequestData = format((info, opts) => {
const addRequestData = format((info) => {
if (httpContext.get('requestId')) info.request_id = httpContext.get('requestId')
if (httpContext.get('requestPath')) info.request_path = httpContext.get('requestPath')
if (httpContext.get('requestIp')) info.request_ip = httpContext.get('requestIp')

View file

@ -256,7 +256,7 @@ const fetchKeybase = (username, fingerprint) => {
profile = await doipjs.openpgp.fetchKeybase(username, fingerprint)
fetchURL = `https://keybase.io/${username}/pgp_keys.asc?fingerprint=${fingerprint}`
} catch (error) {
return reject(new Error('No public keys could be fetched from Keybase'))
return reject(new Error(`No public keys could be fetched from Keybase (${error})`))
}
if (!profile) {

View file

@ -43,7 +43,7 @@ export function generatePageTitle (type, data) {
case 'profile':
try {
return `${data.personas[data.primaryPersonaIndex].name} - Keyoxide`
} catch (error) {
} catch (_err) {
return 'Profile - Keyoxide'
}