From 765f1ede668f70e3af7717bf4d5f05dbf009c7f8 Mon Sep 17 00:00:00 2001 From: toasted-nutbread Date: Sat, 10 Feb 2024 23:12:01 -0500 Subject: Eslint rule updates (#665) * Padding newline rules * Update rules * Update rules * Update rules * Updates * Update object quotes * Merge similar ts and js rules * Change export spacing rules * Move typescript-eslint rules * Spacing * Actually save and commit changes --- ext/js/templates/sandbox/anki-template-renderer.js | 6 +++++- ext/js/templates/template-renderer-proxy.js | 14 +++++++++----- 2 files changed, 14 insertions(+), 6 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 135200da..2320a0b1 100644 --- a/ext/js/templates/sandbox/anki-template-renderer.js +++ b/ext/js/templates/sandbox/anki-template-renderer.js @@ -279,7 +279,10 @@ export class AnkiTemplateRenderer { const regex = new RegExp(pattern, typeof flags === 'string' ? flags : ''); /** @type {string[]} */ const parts = []; - value.replace(regex, (g0) => { parts.push(g0); return g0; }); + value.replace(regex, (g0) => { + parts.push(g0); + return g0; + }); value = parts.join(''); } catch (e) { return `${e}`; @@ -531,6 +534,7 @@ export class AnkiTemplateRenderer { _concat(args) { let result = ''; for (let i = 0, ii = args.length; i < ii; ++i) { + // eslint-disable-next-line @typescript-eslint/restrict-plus-operands result += args[i]; } return result; diff --git a/ext/js/templates/template-renderer-proxy.js b/ext/js/templates/template-renderer-proxy.js index e4814ec4..c1f5a5bf 100644 --- a/ext/js/templates/template-renderer-proxy.js +++ b/ext/js/templates/template-renderer-proxy.js @@ -16,8 +16,8 @@ * along with this program. If not, see . */ -import {generateId} from '../core/utilities.js'; import {ExtensionError} from '../core/extension-error.js'; +import {generateId} from '../core/utilities.js'; export class TemplateRendererProxy { constructor() { @@ -220,10 +220,14 @@ export class TemplateRendererProxy { } }; - let timer = (typeof timeout === 'number' ? setTimeout(() => { - cleanup(); - reject(new Error('Timeout')); - }, timeout) : null); + let timer = ( + typeof timeout === 'number' ? + setTimeout(() => { + cleanup(); + reject(new Error('Timeout')); + }, timeout) : + null + ); this._invocations.add(invocation); -- cgit v1.2.3