diff --git a/cli/api-pulid.js b/cli/api-pulid.js index 033824e9b..23e4eb094 100755 --- a/cli/api-pulid.js +++ b/cli/api-pulid.js @@ -2,9 +2,9 @@ // simple nodejs script to test sdnext api -const fs = require('fs'); -const path = require('path'); -const process = require('process'); +const fs = require('node:fs'); +const path = require('node:path'); + const argparse = require('argparse'); const sd_url = process.env.SDAPI_URL || 'http://127.0.0.1:7860'; diff --git a/cli/api-txt2img.js b/cli/api-txt2img.js index 7b0f6994a..093943c53 100755 --- a/cli/api-txt2img.js +++ b/cli/api-txt2img.js @@ -2,8 +2,7 @@ // simple nodejs script to test sdnext api -const fs = require('fs'); // eslint-disable-line no-undef -const process = require('process'); // eslint-disable-line no-undef +const fs = require('node:fs'); const sd_url = process.env.SDAPI_URL || 'http://127.0.0.1:7860'; const sd_username = process.env.SDAPI_USR; diff --git a/cli/localize.js b/cli/localize.js index 12d289867..48c869185 100755 --- a/cli/localize.js +++ b/cli/localize.js @@ -1,8 +1,8 @@ #!/usr/bin/env node // script used to localize sdnext ui and hints to multiple languages using google gemini ai -const fs = require('fs'); -const process = require('process'); +const fs = require('node:fs'); + const { GoogleGenerativeAI } = require('@google/generative-ai'); const api_key = process.env.GOOGLE_AI_API_KEY; diff --git a/javascript/gallery.js b/javascript/gallery.js index f1b81766c..f2fef113c 100644 --- a/javascript/gallery.js +++ b/javascript/gallery.js @@ -231,7 +231,7 @@ async function handleSeparator(separator) { } async function addSeparators() { - document.querySelectorAll('.gallery-separator').forEach((node) => el.files.removeChild(node)); + document.querySelectorAll('.gallery-separator').forEach((node) => { el.files.removeChild(node); }); const all = Array.from(el.files.children); let lastDir; let isFirstSeparator = true; // Flag to open the first separator by default @@ -537,7 +537,7 @@ async function wsConnect(socket, timeout = 5000) { let loop = 0; while (socket.readyState === WebSocket.CONNECTING && loop < ttl) { - await new Promise((resolve) => setTimeout(resolve, intrasleep)); // eslint-disable-line no-promise-executor-return + await new Promise((resolve) => { setTimeout(resolve, intrasleep); }); loop++; } return isOpened(); diff --git a/javascript/uiConfig.js b/javascript/uiConfig.js index 79356d4ac..113e94d06 100644 --- a/javascript/uiConfig.js +++ b/javascript/uiConfig.js @@ -14,7 +14,7 @@ async function getUIDefaults() { const btn = gradioApp().getElementById('ui_defaults_view'); if (!btn) return; const intersectionObserver = new IntersectionObserver((entries) => { - if (entries[0].intersectionRatio <= 0) { } + if (entries[0].intersectionRatio <= 0) { /* Pass */ } if (entries[0].intersectionRatio > 0) btn.click(); }); intersectionObserver.observe(btn); // monitor visibility of tab