From c05aee8e72cd2d89bb4dd5e1d2ec1e99bea10704 Mon Sep 17 00:00:00 2001 From: valadaptive Date: Sat, 2 Dec 2023 09:17:16 -0500 Subject: [PATCH] Enable no-unsafe-negation lint This actually fixes a bug--the old code was negating "audioData.type" --- .eslintrc.js | 1 - public/scripts/extensions/tts/index.js | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/.eslintrc.js b/.eslintrc.js index f9b7d6392..e120ea8c5 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -65,7 +65,6 @@ module.exports = { 'no-case-declarations': 'off', 'use-isnan': 'off', 'no-self-assign': 'off', - 'no-unsafe-negation': 'off', 'no-constant-condition': ['error', {checkLoops: false}] } }; diff --git a/public/scripts/extensions/tts/index.js b/public/scripts/extensions/tts/index.js index a1f6b7a07..af434d37a 100644 --- a/public/scripts/extensions/tts/index.js +++ b/public/scripts/extensions/tts/index.js @@ -425,7 +425,7 @@ function completeCurrentAudioJob() { */ async function addAudioJob(response) { const audioData = await response.blob() - if (!audioData.type in ['audio/mpeg', 'audio/wav', 'audio/x-wav', 'audio/wave', 'audio/webm']) { + if (!(audioData.type in ['audio/mpeg', 'audio/wav', 'audio/x-wav', 'audio/wave', 'audio/webm'])) { throw `TTS received HTTP response with invalid data format. Expecting audio/mpeg, got ${audioData.type}` } audioJobQueue.push(audioData)