Skip to content

~95% on SimpleQA (e.g. Qwen3.6-27B on a 3090). Supports all local and cloud LLMs (llama.cpp, Ollama, Google, ...). 10+ search engines - arXiv, PubMed, your private documents. Everything Local & Encrypted.

chore(lint): enable no-return-assign + no-case-declarations (#3636)

LearningCircuit32b0273425fc
diff --git a/eslint.config.js b/eslint.config.js
index 5552a12e26..f2b73f4f29 100644
--- a/eslint.config.js
+++ b/eslint.config.js
@@ -215,6 +215,11 @@ export default [
// Forbid variable shadowing — clearer reads, fewer accidental rebinds
"no-shadow": "error",
+
+ // Catch `return a = b` (almost always unintentional) and lexical declarations
+ // floating in switch cases (which leak across cases without block scoping)
+ "no-return-assign": "error",
+ "no-case-declarations": "error",
},
languageOptions: {
diff --git a/src/local_deep_research/web/static/js/components/progress.js b/src/local_deep_research/web/static/js/components/progress.js
index b2b8941105..939e2ecc7a 100644
--- a/src/local_deep_research/web/static/js/components/progress.js
+++ b/src/local_deep_research/web/static/js/components/progress.js
@@ -1186,7 +1186,7 @@
label = '💭 THINKING';
stepContent = data.thought || data.message || '';
break;
- case 'tool_call':
+ case 'tool_call': {
stepType = 'action';
label = '🔧 ACTION';
const tool = data.tool || 'unknown';
@@ -1198,7 +1198,8 @@
stepContent += `\nArgs: ${JSON.stringify(args, null, 2)}`;
}
break;
- case 'observation':
+ }
+ case 'observation': {
stepType = 'result';
label = '📋 RESULT';
// Use content if available, otherwise message
@@ -1208,6 +1209,7 @@
}
stepContent = resultText;
break;
+ }
case 'error':
stepType = 'error';
label = '❌ ERROR';
diff --git a/src/local_deep_research/web/static/js/components/settings.js b/src/local_deep_research/web/static/js/components/settings.js
index b37ade62f1..b28855b1c6 100644
--- a/src/local_deep_research/web/static/js/components/settings.js
+++ b/src/local_deep_research/web/static/js/components/settings.js
@@ -1969,7 +1969,7 @@
`;
break;
- case 'json':
+ case 'json': {
const jsonClass = ' ldr-json-content';
// Try to format the JSON for better display
@@ -1997,6 +1997,7 @@
>${setting.value !== null ? escapeHtml(String(setting.value)) : ''}</textarea>
`;
break;
+ }
case 'select':
// Handle specific keys that should use custom dropdowns
@@ -2078,7 +2079,7 @@
}
break;
- case 'checkbox':
+ case 'checkbox': {
const checked = setting.value === true || setting.value === 'true' ? 'checked' : '';
const hiddenFallbackId = `${settingId}_hidden_fallback`;
inputElement = `
@@ -2102,9 +2103,10 @@
</div>
`;
break;
+ }
case 'slider':
- case 'range':
+ case 'range': {
const min = setting.min_value !== null ? setting.min_value : 0;
const max = setting.max_value !== null ? setting.max_value : 100;
const step = setting.step !== null ? setting.step : 1;
@@ -2121,8 +2123,9 @@
</div>
`;
break;
+ }
- case 'number':
+ case 'number': {
const numMin = setting.min_value !== null ? setting.min_value : '';
const numMax = setting.max_value !== null ? setting.max_value : '';
const numStep = setting.step !== null ? setting.step : 1;
@@ -2136,6 +2139,7 @@
>
`;
break;
+ }
// Add a case for explicit custom dropdown if needed, or handle in default
// case 'custom_dropdown':
diff --git a/src/local_deep_research/web/static/js/services/keyboard.js b/src/local_deep_research/web/static/js/services/keyboard.js
index b745fff63d..ac6f2e6ebd 100644
--- a/src/local_deep_research/web/static/js/services/keyboard.js
+++ b/src/local_deep_research/web/static/js/services/keyboard.js
@@ -176,7 +176,7 @@
allShortcuts.escape = {
keys: ['escape'],
description: 'Back to new search',
- handler: () => window.location.href = URLS.PAGES.HOME
+ handler: () => { window.location.href = URLS.PAGES.HOME; }
};
}
diff --git a/tests/puppeteer/helpers/index.js b/tests/puppeteer/helpers/index.js
index 3191aef4d7..6c099b2447 100644
--- a/tests/puppeteer/helpers/index.js
+++ b/tests/puppeteer/helpers/index.js
@@ -88,7 +88,7 @@ async function waitAndType(page, selector, text, options = {}) {
console.log(` Waiting for: ${selector}`);
await page.waitForSelector(selector, { timeout, visible: true });
if (clear) {
- await page.$eval(selector, el => el.value = '');
+ await page.$eval(selector, el => { el.value = ''; });
}
console.log(` Typing into: ${selector}`);
await page.type(selector, text);
@@ -159,8 +159,8 @@ async function loginUser(page, username, password) {
// Clear and fill form
console.log(` loginUser: Filling form for ${username}`);
- await page.$eval('input[name="username"]', el => el.value = '');
- await page.$eval('input[name="password"]', el => el.value = '');
+ await page.$eval('input[name="username"]', el => { el.value = ''; });
+ await page.$eval('input[name="password"]', el => { el.value = ''; });
await page.type('input[name="username"]', username);
await page.type('input[name="password"]', password);
await page.click('button[type="submit"]');
diff --git a/tests/ui_tests/auth_helper.js b/tests/ui_tests/auth_helper.js
index 2a02455cba..fbbc1b8d08 100644
--- a/tests/ui_tests/auth_helper.js
+++ b/tests/ui_tests/auth_helper.js
@@ -303,8 +303,8 @@ class AuthHelper {
timer.lap('login form ready');
// Clear fields first to ensure clean state
- await this.page.$eval('input[name="username"]', el => el.value = '');
- await this.page.$eval('input[name="password"]', el => el.value = '');
+ await this.page.$eval('input[name="username"]', el => { el.value = ''; });
+ await this.page.$eval('input[name="password"]', el => { el.value = ''; });
// Type credentials
await this.page.type('input[name="username"]', username);
diff --git a/tests/ui_tests/test_api_key_inputs.js b/tests/ui_tests/test_api_key_inputs.js
index 34e21b808d..1ec24f910d 100644
--- a/tests/ui_tests/test_api_key_inputs.js
+++ b/tests/ui_tests/test_api_key_inputs.js
@@ -269,7 +269,7 @@ async function testApiKeyInputs() {
});
// Clear and type a new value, then blur to trigger save
- await page.$eval('#openai_api_key', el => el.value = '');
+ await page.$eval('#openai_api_key', el => { el.value = ''; });
await page.type('#openai_api_key', 'sk-new-test-key');
await page.click('#model_provider'); // Click elsewhere to trigger blur/change
await page.waitForTimeout(500);
diff --git a/tests/ui_tests/test_autocomplete_selection.js b/tests/ui_tests/test_autocomplete_selection.js
index 4d14e641ed..baa22fdd4d 100644
--- a/tests/ui_tests/test_autocomplete_selection.js
+++ b/tests/ui_tests/test_autocomplete_selection.js
@@ -67,7 +67,7 @@ async function runTests() {
const firstItemText = await page.evaluate(el => el.textContent, dropdownItems[0]);
// Clear input and type part of the model name
- await page.evaluate(() => document.getElementById('model').value = '');
+ await page.evaluate(() => { document.getElementById('model').value = ''; });
const searchText = firstItemText.substring(0, Math.min(3, firstItemText.length));
await page.type('#model', searchText);
console.log(` Typed "${searchText}" to filter models`);
@@ -155,7 +155,7 @@ async function runTests() {
const firstItemText = await page.evaluate(el => el.textContent, dropdownItems[0]);
// Clear input and type part of the search engine name
- await page.evaluate(() => document.getElementById('search_engine').value = '');
+ await page.evaluate(() => { document.getElementById('search_engine').value = ''; });
const searchText = firstItemText.substring(0, Math.min(3, firstItemText.length));
await page.type('#search_engine', searchText);
console.log(` Typed "${searchText}" to filter search engines`);
@@ -277,7 +277,7 @@ async function runTests() {
if (firstModelText) {
// Clear and type part of the model name
- await page.evaluate(() => document.getElementById('model').value = '');
+ await page.evaluate(() => { document.getElementById('model').value = ''; });
const searchText = firstModelText.substring(0, Math.min(5, firstModelText.length));
await page.type('#model', searchText);
console.log(` Typed "${searchText}"`);
diff --git a/tests/ui_tests/test_change_password_validation.js b/tests/ui_tests/test_change_password_validation.js
index 2cfd1757a1..20beba4060 100644
--- a/tests/ui_tests/test_change_password_validation.js
+++ b/tests/ui_tests/test_change_password_validation.js
@@ -200,7 +200,7 @@ async function testChangePasswordValidation() {
// Clear and type a weak password (short, lowercase-only, no digit)
// Strength algorithm: +1 for length>=8, +1 for length>=12, +1 for lowercase, +1 for digit
// "abcdefg" scores 1 (lowercase only) → strength<=1 → weak
- await page.evaluate(() => document.querySelector('input[name="new_password"]').value = '');
+ await page.evaluate(() => { document.querySelector('input[name="new_password"]').value = ''; });
await page.type('input[name="new_password"]', 'abcdefg', { delay: 50 });
await new Promise(resolve => setTimeout(resolve, 200));
@@ -227,7 +227,7 @@ async function testChangePasswordValidation() {
}
// Test strong password
- await page.evaluate(() => document.querySelector('input[name="new_password"]').value = '');
+ await page.evaluate(() => { document.querySelector('input[name="new_password"]').value = ''; });
await page.type('input[name="new_password"]', 'StrongPass123!', { delay: 50 });
await new Promise(resolve => setTimeout(resolve, 200));
diff --git a/tests/ui_tests/test_error_handling_ci.js b/tests/ui_tests/test_error_handling_ci.js
index 7362b08478..7bf14c42d3 100644
--- a/tests/ui_tests/test_error_handling_ci.js
+++ b/tests/ui_tests/test_error_handling_ci.js
@@ -547,8 +547,8 @@ async function main() {
try {
await page.goto(`${baseUrl}/auth/login`, { waitUntil: 'domcontentloaded', timeout: 15000 });
await page.waitForSelector('input[name="username"]', { timeout: 10000 });
- await page.$eval('input[name="username"]', el => el.value = '');
- await page.$eval('input[name="password"]', el => el.value = '');
+ await page.$eval('input[name="username"]', el => { el.value = ''; });
+ await page.$eval('input[name="password"]', el => { el.value = ''; });
await page.type('input[name="username"]', 'test_admin');
await page.type('input[name="password"]', 'testpass123');
await page.click('button[type="submit"]');
diff --git a/tests/ui_tests/test_export_functionality.js b/tests/ui_tests/test_export_functionality.js
index 7d97536ab0..e90c8d429e 100644
--- a/tests/ui_tests/test_export_functionality.js
+++ b/tests/ui_tests/test_export_functionality.js
@@ -72,7 +72,7 @@ async function configureExportSettings(page) {
const select = document.querySelector('select[name*="export_format"][multiple]');
if (select) {
// Clear existing selections
- Array.from(select.options).forEach(opt => opt.selected = false);
+ Array.from(select.options).forEach(opt => { opt.selected = false; });
// Select specified formats
formats.forEach(format => {
diff --git a/tests/ui_tests/test_queue_simple.js b/tests/ui_tests/test_queue_simple.js
index c9ed33a63b..ee3a872678 100644
--- a/tests/ui_tests/test_queue_simple.js
+++ b/tests/ui_tests/test_queue_simple.js
@@ -34,7 +34,7 @@ async function submitResearch(page, query, index) {
// Fill form
try {
await page.waitForSelector('#query', { timeout: 5000 });
- await page.evaluate(() => document.querySelector('#query').value = '');
+ await page.evaluate(() => { document.querySelector('#query').value = ''; });
await page.type('#query', query);
// Select model
diff --git a/tests/ui_tests/test_register_full_flow.js b/tests/ui_tests/test_register_full_flow.js
index 30ae3efa4c..d96a152e6d 100644
--- a/tests/ui_tests/test_register_full_flow.js
+++ b/tests/ui_tests/test_register_full_flow.js
@@ -77,7 +77,7 @@ async function testRegisterFullFlow() {
}
// Clear and test with longer username (should also be valid)
- await page.evaluate(() => document.querySelector('input[name="username"]').value = '');
+ await page.evaluate(() => { document.querySelector('input[name="username"]').value = ''; });
await page.type('input[name="username"]', 'testuser', { delay: 50 });
validity = await page.evaluate(el => ({
@@ -120,7 +120,7 @@ async function testRegisterFullFlow() {
console.log('\n📋 Test 3: Password strength indicator');
// Clear password
- await page.evaluate(() => document.querySelector('input[name="password"]').value = '');
+ await page.evaluate(() => { document.querySelector('input[name="password"]').value = ''; });
// Test weak password (short lowercase-only, scores strength=1: only lowercase match)
// Strength algorithm: +1 for length>=8, +1 for length>=12, +1 for lowercase, +1 for digit
@@ -152,7 +152,7 @@ async function testRegisterFullFlow() {
}
// Test strong password
- await page.evaluate(() => document.querySelector('input[name="password"]').value = '');
+ await page.evaluate(() => { document.querySelector('input[name="password"]').value = ''; });
await page.type('input[name="password"]', 'StrongPass123!', { delay: 50 });
await new Promise(resolve => setTimeout(resolve, 200));
diff --git a/tests/ui_tests/test_register_validation.js b/tests/ui_tests/test_register_validation.js
index bff1860f32..3408e7982b 100644
--- a/tests/ui_tests/test_register_validation.js
+++ b/tests/ui_tests/test_register_validation.js
@@ -124,7 +124,7 @@ async function testRegisterValidation() {
}
// Clear the input
- await page.evaluate(() => document.querySelector('input[name="username"]').value = '');
+ await page.evaluate(() => { document.querySelector('input[name="username"]').value = ''; });
// Test 4: Type numbers only - should be valid
console.log('\n📋 Test 4: Typing numbers only');
@@ -151,7 +151,7 @@ async function testRegisterValidation() {
}
// Clear the input
- await page.evaluate(() => document.querySelector('input[name="username"]').value = '');
+ await page.evaluate(() => { document.querySelector('input[name="username"]').value = ''; });
// Test 5: Type mixed letters and numbers - should be valid
console.log('\n📋 Test 5: Typing mixed letters and numbers');
@@ -176,7 +176,7 @@ async function testRegisterValidation() {
}
// Clear the input
- await page.evaluate(() => document.querySelector('input[name="username"]').value = '');
+ await page.evaluate(() => { document.querySelector('input[name="username"]').value = ''; });
// Test 6: Type with underscores and hyphens - should be valid
console.log('\n📋 Test 6: Typing with underscores and hyphens');
@@ -201,7 +201,7 @@ async function testRegisterValidation() {
}
// Clear the input
- await page.evaluate(() => document.querySelector('input[name="username"]').value = '');
+ await page.evaluate(() => { document.querySelector('input[name="username"]').value = ''; });
// Test 7: Pattern attribute verification
// Note: Headless Chromium doesn't reliably update validity.patternMismatch for all patterns.
@@ -223,7 +223,7 @@ async function testRegisterValidation() {
}
// Clear the input
- await page.evaluate(() => document.querySelector('input[name="username"]').value = '');
+ await page.evaluate(() => { document.querySelector('input[name="username"]').value = ''; });
// Test 8: Check for any visual validation indicators
console.log('\n📋 Test 8: Visual validation state check');
@@ -266,7 +266,7 @@ async function testRegisterValidation() {
// Test 9: Invalid username shows is-invalid class
console.log('\n📋 Test 9: Invalid username shows is-invalid class');
- await page.evaluate(() => document.querySelector('input[name="username"]').value = '');
+ await page.evaluate(() => { document.querySelector('input[name="username"]').value = ''; });
await page.focus('input[name="username"]');
await page.keyboard.type('@invalid!', { delay: 50 });
// Trigger blur to activate validation
@@ -286,7 +286,7 @@ async function testRegisterValidation() {
// Test 10: Valid username shows is-valid class
console.log('\n📋 Test 10: Valid username shows is-valid class');
- await page.evaluate(() => document.querySelector('input[name="username"]').value = '');
+ await page.evaluate(() => { document.querySelector('input[name="username"]').value = ''; });
await page.focus('input[name="username"]');
await page.keyboard.type('validuser', { delay: 50 });
// Trigger blur to activate validation
@@ -306,7 +306,7 @@ async function testRegisterValidation() {
// Test 11: Error message displays for invalid input
console.log('\n📋 Test 11: Error message displays for invalid input');
- await page.evaluate(() => document.querySelector('input[name="username"]').value = '');
+ await page.evaluate(() => { document.querySelector('input[name="username"]').value = ''; });
await page.focus('input[name="username"]');
await page.keyboard.type('@bad!', { delay: 50 });
await page.click('input[name="password"]');
@@ -333,7 +333,7 @@ async function testRegisterValidation() {
// Test 12: Error message clears on valid input
console.log('\n📋 Test 12: Error message clears on valid input');
- await page.evaluate(() => document.querySelector('input[name="username"]').value = '');
+ await page.evaluate(() => { document.querySelector('input[name="username"]').value = ''; });
await page.focus('input[name="username"]');
await page.keyboard.type('validuser', { delay: 50 });
await page.click('input[name="password"]');
@@ -365,7 +365,7 @@ async function testRegisterValidation() {
// Test 13: Password field does NOT show error while typing short password
console.log('\n📋 Test 13: Password field does NOT show error while typing short password');
- await page.evaluate(() => document.querySelector('input[name="password"]').value = '');
+ await page.evaluate(() => { document.querySelector('input[name="password"]').value = ''; });
await page.focus('input[name="password"]');
await page.keyboard.type('abc', { delay: 50 });
// Do NOT trigger blur - stay focused on the field
@@ -398,7 +398,7 @@ async function testRegisterValidation() {
// Test 14: Password field shows error AFTER blur when password too short
console.log('\n📋 Test 14: Password field shows error AFTER blur when password too short');
- await page.evaluate(() => document.querySelector('input[name="password"]').value = '');
+ await page.evaluate(() => { document.querySelector('input[name="password"]').value = ''; });
await page.focus('input[name="password"]');
await page.keyboard.type('short', { delay: 50 });
// Trigger blur by clicking another field
@@ -456,7 +456,7 @@ async function testRegisterValidation() {
// Test 16: ARIA aria-invalid attribute updates with validation state
console.log('\n📋 Test 16: ARIA aria-invalid attribute updates with validation state');
// Clear and type invalid username
- await page.evaluate(() => document.querySelector('input[name="username"]').value = '');
+ await page.evaluate(() => { document.querySelector('input[name="username"]').value = ''; });
await page.focus('input[name="username"]');
await page.keyboard.type('@invalid!', { delay: 50 });
await page.click('input[name="password"]');
@@ -469,7 +469,7 @@ async function testRegisterValidation() {
console.log(` aria-invalid after invalid input: "${ariaInvalidTrue}"`);
// Now type valid username
- await page.evaluate(() => document.querySelector('input[name="username"]').value = '');
+ await page.evaluate(() => { document.querySelector('input[name="username"]').value = ''; });
await page.focus('input[name="username"]');
await page.keyboard.type('validuser', { delay: 50 });
await page.click('input[name="password"]');
@@ -533,7 +533,7 @@ async function testRegisterValidation() {
// Test 18: Password strength indicator visible during typing (UX check)
console.log('\n📋 Test 18: Password strength indicator visible during typing (UX check)');
- await page.evaluate(() => document.querySelector('input[name="password"]').value = '');
+ await page.evaluate(() => { document.querySelector('input[name="password"]').value = ''; });
await page.focus('input[name="password"]');
await page.keyboard.type('TestPass', { delay: 50 });
await new Promise(resolve => setTimeout(resolve, 200));
diff --git a/tests/ui_tests/test_research_form_validation.js b/tests/ui_tests/test_research_form_validation.js
index 6bbbf11477..a2d9dbb9b5 100644
--- a/tests/ui_tests/test_research_form_validation.js
+++ b/tests/ui_tests/test_research_form_validation.js
@@ -102,7 +102,7 @@ async function testResearchFormValidation() {
console.log('\n📋 Test 3: Empty query handling');
// Clear the query input
- await page.evaluate(el => el.value = '', queryInput);
+ await page.evaluate(el => { el.value = ''; }, queryInput);
// Check if submit button is disabled or if form prevents submission
const submitBtn = await page.$('button[type="submit"], #start-research, .ldr-btn-research');
diff --git a/tests/ui_tests/test_settings_persistence.js b/tests/ui_tests/test_settings_persistence.js
index 6228043a12..e48e1186fe 100644
--- a/tests/ui_tests/test_settings_persistence.js
+++ b/tests/ui_tests/test_settings_persistence.js
@@ -107,7 +107,7 @@ async function modifySettings(page) {
// Max tokens
const maxTokensInput = await page.$('input[name="llm.max_tokens"], #max-tokens');
if (maxTokensInput) {
- await page.evaluate((el) => el.value = '', maxTokensInput);
+ await page.evaluate((el) => { el.value = ''; }, maxTokensInput);
await page.type('input[name="llm.max_tokens"], #max-tokens', testSettings.maxTokens.toString());
log(` - Max tokens set to: ${testSettings.maxTokens}`, 'info');
}
@@ -115,7 +115,7 @@ async function modifySettings(page) {
// Search iterations
const iterationsInput = await page.$('input[name="search.iterations"], #search-iterations');
if (iterationsInput) {
- await page.evaluate((el) => el.value = '', iterationsInput);
+ await page.evaluate((el) => { el.value = ''; }, iterationsInput);
await page.type('input[name="search.iterations"], #search-iterations', testSettings.iterations.toString());
log(` - Search iterations set to: ${testSettings.iterations}`, 'info');
}
@@ -123,7 +123,7 @@ async function modifySettings(page) {
// Questions per iteration
const questionsInput = await page.$('input[name="search.questions_per_iteration"], #questions-per-iteration');
if (questionsInput) {
- await page.evaluate((el) => el.value = '', questionsInput);
+ await page.evaluate((el) => { el.value = ''; }, questionsInput);
await page.type('input[name="search.questions_per_iteration"], #questions-per-iteration', testSettings.questionsPerIteration.toString());
log(` - Questions per iteration set to: ${testSettings.questionsPerIteration}`, 'info');
}