From 6bf7b0055765c4f2011c9614753d6714dc09be65 Mon Sep 17 00:00:00 2001 From: toasted-nutbread Date: Wed, 14 Feb 2024 22:26:29 -0500 Subject: Eslint rule updates (#673) * Install unicorn * Add rules * Fix issues * Install sonarjs * Set up rules * Fix issues * Install eslint-plugin-import and fix import extensions * Simplify permitted error names --- ext/js/templates/sandbox/anki-template-renderer.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'ext/js/templates') diff --git a/ext/js/templates/sandbox/anki-template-renderer.js b/ext/js/templates/sandbox/anki-template-renderer.js index 2320a0b1..ad2b0042 100644 --- a/ext/js/templates/sandbox/anki-template-renderer.js +++ b/ext/js/templates/sandbox/anki-template-renderer.js @@ -171,11 +171,11 @@ export class AnkiTemplateRenderer { for (const {text, reading: reading2} of segments) { const safeText = this._escape(text); const safeReading = this._escape(reading2); - if (safeReading.length > 0) { - result += `${safeText}${safeReading}`; - } else { - result += safeText; - } + result += ( + safeReading.length > 0 ? + `${safeText}${safeReading}` : + safeText + ); } return this._safeString(result); -- cgit v1.2.3