Enable no-extra-semi lint

This commit is contained in:
valadaptive
2023-12-02 10:15:03 -05:00
parent 27e63a7a77
commit 0a27275772
12 changed files with 21 additions and 22 deletions

View File

@@ -56,7 +56,6 @@ module.exports = {
'no-redeclare': 'off', 'no-redeclare': 'off',
'no-async-promise-executor': 'off', 'no-async-promise-executor': 'off',
'no-inner-declarations': 'off', 'no-inner-declarations': 'off',
'no-extra-semi': 'off',
'no-undef': 'off', 'no-undef': 'off',
'no-prototype-builtins': 'off', 'no-prototype-builtins': 'off',
'no-extra-boolean-cast': 'off', 'no-extra-boolean-cast': 'off',

View File

@@ -3835,7 +3835,7 @@ async function Generate(type, { automatic_trigger, force_name2, resolve, reject,
triggerAutoContinue(messageChunk, isImpersonate); triggerAutoContinue(messageChunk, isImpersonate);
resolve(); resolve();
} }
}; }
function onError(exception) { function onError(exception) {
if (typeof exception?.error?.message === 'string') { if (typeof exception?.error?.message === 'string') {
@@ -3846,7 +3846,7 @@ async function Generate(type, { automatic_trigger, force_name2, resolve, reject,
unblockGeneration(); unblockGeneration();
console.log(exception); console.log(exception);
streamingProcessor = null; streamingProcessor = null;
}; }
} //rungenerate ends } //rungenerate ends
} else { //generate's primary loop ends, after this is error handling for no-connection or safety-id } else { //generate's primary loop ends, after this is error handling for no-connection or safety-id
@@ -7890,7 +7890,7 @@ jQuery(async function () {
if (popup_type == 'avatarToCrop') { if (popup_type == 'avatarToCrop') {
dialogueResolve($("#avatarToCrop").data('cropper').getCroppedCanvas().toDataURL('image/jpeg')); dialogueResolve($("#avatarToCrop").data('cropper').getCroppedCanvas().toDataURL('image/jpeg'));
}; }
if (popup_type == "del_chat") { if (popup_type == "del_chat") {
//close past chat popup //close past chat popup
@@ -9171,7 +9171,7 @@ jQuery(async function () {
$(document).on('click', '.inline-drawer-toggle', function (e) { $(document).on('click', '.inline-drawer-toggle', function (e) {
if ($(e.target).hasClass('text_pole')) { if ($(e.target).hasClass('text_pole')) {
return; return;
}; }
var icon = $(this).find('.inline-drawer-icon'); var icon = $(this).find('.inline-drawer-icon');
icon.toggleClass('down up'); icon.toggleClass('down up');
icon.toggleClass('fa-circle-chevron-down fa-circle-chevron-up'); icon.toggleClass('fa-circle-chevron-down fa-circle-chevron-up');

View File

@@ -691,7 +691,7 @@ async function onDeleteClick() {
if (confirmation) { if (confirmation) {
await deleteExtension(extensionName); await deleteExtension(extensionName);
} }
}; }
export async function deleteExtension(extensionName) { export async function deleteExtension(extensionName) {
try { try {

View File

@@ -2416,7 +2416,7 @@ async function sdMessageButton(e) {
context.saveChat(); context.saveChat();
} }
}; }
$("#sd_dropdown [id]").on("click", function () { $("#sd_dropdown [id]").on("click", function () {
const id = $(this).attr("id"); const id = $(this).attr("id");

View File

@@ -124,4 +124,4 @@ export function initLocales() {
registerDebugFunction('getMissingTranslations', 'Get missing translations', 'Detects missing localization data and dumps the data into the browser console.', getMissingTranslations); registerDebugFunction('getMissingTranslations', 'Get missing translations', 'Detects missing localization data and dumps the data into the browser console.', getMissingTranslations);
registerDebugFunction('applyLocale', 'Apply locale', 'Reapplies the currently selected locale to the page.', applyLocale); registerDebugFunction('applyLocale', 'Apply locale', 'Reapplies the currently selected locale to the page.', applyLocale);
}; }

View File

@@ -1860,7 +1860,7 @@ class Message {
* Returns the number of tokens in the message. * Returns the number of tokens in the message.
* @returns {number} Number of tokens in the message. * @returns {number} Number of tokens in the message.
*/ */
getTokens() { return this.tokens }; getTokens() { return this.tokens }
} }
/** /**
@@ -2239,14 +2239,14 @@ class ChatCompletion {
reserveBudget(message) { reserveBudget(message) {
const tokens = typeof message === 'number' ? message : message.getTokens(); const tokens = typeof message === 'number' ? message : message.getTokens();
this.decreaseTokenBudgetBy(tokens); this.decreaseTokenBudgetBy(tokens);
}; }
/** /**
* Frees up the tokens used by the given message from the token budget. * Frees up the tokens used by the given message from the token budget.
* *
* @param {Message|MessageCollection} message - The message whose tokens to free. * @param {Message|MessageCollection} message - The message whose tokens to free.
*/ */
freeBudget(message) { this.increaseTokenBudgetBy(message.getTokens()) }; freeBudget(message) { this.increaseTokenBudgetBy(message.getTokens()) }
/** /**
* Increases the token budget by the given number of tokens. * Increases the token budget by the given number of tokens.

View File

@@ -834,7 +834,7 @@ async function CreateZenSliders(elmnt) {
originalSlider.data("newSlider", newSlider); originalSlider.data("newSlider", newSlider);
await delay(1) await delay(1)
originalSlider.hide(); originalSlider.hide();
}; }
function switchUiMode() { function switchUiMode() {
const fastUi = localStorage.getItem(storage_keys.fast_ui_mode); const fastUi = localStorage.getItem(storage_keys.fast_ui_mode);
power_user.fast_ui_mode = fastUi === null ? true : fastUi == "true"; power_user.fast_ui_mode = fastUi === null ? true : fastUi == "true";
@@ -894,7 +894,7 @@ function switchMovingUI() {
if (power_user.movingUIState) { if (power_user.movingUIState) {
loadMovingUIState(); loadMovingUIState();
} }
}; }
} }
function noShadows() { function noShadows() {
@@ -1239,7 +1239,7 @@ async function applyTheme(name) {
if (type) await applyThemeColor(type); if (type) await applyThemeColor(type);
if (action) await action(); if (action) await action();
} else { } else {
if (selector) { $(selector).attr('color', 'rgba(0,0,0,0)') }; if (selector) { $(selector).attr('color', 'rgba(0,0,0,0)') }
console.debug(`Empty theme key: ${key}`); console.debug(`Empty theme key: ${key}`);
power_user[key] = ''; power_user[key] = '';
} }
@@ -2985,7 +2985,7 @@ $(document).ready(() => {
if (power_user.enableZenSliders === true && value === true) { if (power_user.enableZenSliders === true && value === true) {
//disallow Lab Mode if ZenSliders are active //disallow Lab Mode if ZenSliders are active
toastr.warning('Disable Zen Sliders before enabling Mad Lab Mode') toastr.warning('Disable Zen Sliders before enabling Mad Lab Mode')
$(this).prop('checked', false).trigger('input');; $(this).prop('checked', false).trigger('input');
return return
} }

View File

@@ -261,7 +261,7 @@ async function importTags(imported_char) {
tag_map[imported_char.avatar].push(tag.id); tag_map[imported_char.avatar].push(tag.id);
console.debug('added tag to map', tag, imported_char.name); console.debug('added tag to map', tag, imported_char.name);
} }
}; }
saveSettingsDebounced(); saveSettingsDebounced();
await getCharacters(); await getCharacters();
printTagFilters(tag_filter_types.character); printTagFilters(tag_filter_types.character);

View File

@@ -244,7 +244,7 @@ export function getStringHash(str, seed = 0) {
h2 = Math.imul(h2 ^ (h2 >>> 16), 2246822507) ^ Math.imul(h1 ^ (h1 >>> 13), 3266489909); h2 = Math.imul(h2 ^ (h2 >>> 16), 2246822507) ^ Math.imul(h1 ^ (h1 >>> 13), 3266489909);
return 4294967296 * (2097151 & h2) + (h1 >>> 0); return 4294967296 * (2097151 & h2) + (h1 >>> 0);
}; }
/** /**
* Creates a debounced function that delays invoking func until after wait milliseconds have elapsed since the last time the debounced function was invoked. * Creates a debounced function that delays invoking func until after wait milliseconds have elapsed since the last time the debounced function was invoked.
@@ -344,7 +344,7 @@ export function incrementString(str) {
// Take the substring up until where the integer was matched // Take the substring up until where the integer was matched
// Concatenate it to the matched count incremented by 1 // Concatenate it to the matched count incremented by 1
return str.substring(0, count.index) + (Number(count[0]) + 1); return str.substring(0, count.index) + (Number(count[0]) + 1);
}; }
/** /**
* Formats a string using the specified arguments. * Formats a string using the specified arguments.
@@ -361,7 +361,7 @@ export function stringFormat(format) {
: match : match
; ;
}); });
}; }
/** /**
* Save the caret position in a contenteditable element. * Save the caret position in a contenteditable element.

View File

@@ -133,7 +133,7 @@ export function replaceVariableMacros(input) {
// Replace {{addvar::name::value}} with empty string and add value to the variable value // Replace {{addvar::name::value}} with empty string and add value to the variable value
line = line.replace(/{{addvar::([^:]+)::([^}]+)}}/gi, (_, name, value) => { line = line.replace(/{{addvar::([^:]+)::([^}]+)}}/gi, (_, name, value) => {
name = name.trim(); name = name.trim();
addLocalVariable(name, value);; addLocalVariable(name, value);
return ''; return '';
}); });

View File

@@ -204,7 +204,7 @@ function humanizedISO8601DateTime(date) {
let humanMillisecond = (baseDate.getMilliseconds() < 10 ? '0' : '') + baseDate.getMilliseconds(); let humanMillisecond = (baseDate.getMilliseconds() < 10 ? '0' : '') + baseDate.getMilliseconds();
let HumanizedDateTime = (humanYear + "-" + humanMonth + "-" + humanDate + " @" + humanHour + "h " + humanMinute + "m " + humanSecond + "s " + humanMillisecond + "ms"); let HumanizedDateTime = (humanYear + "-" + humanMonth + "-" + humanDate + " @" + humanHour + "h " + humanMinute + "m " + humanSecond + "s " + humanMillisecond + "ms");
return HumanizedDateTime; return HumanizedDateTime;
}; }
var charactersPath = 'public/characters/'; var charactersPath = 'public/characters/';
var chatsPath = 'public/chats/'; var chatsPath = 'public/chats/';

View File

@@ -35,7 +35,7 @@ function checkAssetFileName(inputFilename) {
return ''; return '';
} }
return path.normalize(inputFilename).replace(/^(\.\.(\/|\\|$))+/, '');; return path.normalize(inputFilename).replace(/^(\.\.(\/|\\|$))+/, '');
} }
// Recursive function to get files // Recursive function to get files