Fix up linting errors

This commit is contained in:
Tom Sightler
2024-08-06 23:03:40 -04:00
parent c762930458
commit d1abc0a7d1
16 changed files with 501 additions and 701 deletions

View File

@@ -31,10 +31,11 @@ export default new class Config {
await this.loadConfigFile()
this.doMqttDiscovery()
break;
default:
default: {
const configPath = dirname(fileURLToPath(new URL('.', import.meta.url)))+'/'
this.file = (process.env.RINGMQTT_CONFIG) ? configPath+process.env.RINGMQTT_CONFIG : configPath+'config.json'
await this.loadConfigFile()
}
}
// If there's still no configured settings, force some defaults.

View File

@@ -1,5 +1,5 @@
import exithandler from './exithandler.js'
import mqtt from './mqtt.js'
export * from './exithandler.js'
export * from './mqtt.js'
import state from './state.js'
import ring from './ring.js'
import utils from './utils.js'

View File

@@ -241,6 +241,7 @@ export default new class RingMqtt {
case 'not-supported':
// Save unsupported device type for log output later
unsupportedDevices.push(device.deviceType)
// fall through
case 'ignore':
ringDevice=false
break

View File

@@ -87,9 +87,7 @@ export class WeriftPeerConnection extends Subscribed {
this.addSubscriptions(merge(this.onRequestKeyFrame, interval(4000)).subscribe(() => {
videoTransceiver.receiver
.sendRtcpPLI(track.ssrc)
.catch((e) => {
// debug(e)
})
.catch()
}))
this.requestKeyFrame()
})
@@ -131,9 +129,7 @@ export class WeriftPeerConnection extends Subscribed {
}
close() {
this.pc.close().catch((e) => {
//debug
})
this.pc.close().catch()
this.unsubscribe()
}
}

View File

@@ -150,7 +150,7 @@ export class WebrtcConnection extends Subscribed {
return
case 'pong':
return
case 'notification':
case 'notification': {
const { text } = message.body
if (text === 'camera_connected') {
this.onCameraConnected.next()
@@ -162,6 +162,7 @@ export class WebrtcConnection extends Subscribed {
return
}
break
}
case 'close':
this.callEnded()
return
@@ -219,7 +220,7 @@ export class WebrtcConnection extends Subscribed {
})
this.ws.close()
}
catch (_) {
catch {
// ignore any errors since we are stopping the call
}
this.hasEnded = true

View File

@@ -100,7 +100,7 @@ export default new class TokenApp {
const code = req.body.code
try {
generatedToken = await restClient.getAuth(code)
} catch(err) {
} catch {
generatedToken = false
const errormsg = 'The 2FA code was not accepted, please verify the code and try again.'
debug(errormsg)