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 radix + add explicit base to 45 parseInt calls (#3640)

LearningCircuit23dfd2577792
diff --git a/eslint.config.js b/eslint.config.js
index f2b73f4f29..47c5ae9bb3 100644
--- a/eslint.config.js
+++ b/eslint.config.js
@@ -220,6 +220,9 @@ export default [
// floating in switch cases (which leak across cases without block scoping)
"no-return-assign": "error",
"no-case-declarations": "error",
+
+ // Always pass radix to parseInt — explicit base avoids surprise
+ "radix": "error",
},
languageOptions: {
diff --git a/src/local_deep_research/web/static/js/components/logpanel.js b/src/local_deep_research/web/static/js/components/logpanel.js
index 8bacfda146..b7b676d50f 100644
--- a/src/local_deep_research/web/static/js/components/logpanel.js
+++ b/src/local_deep_research/web/static/js/components/logpanel.js
@@ -789,7 +789,7 @@
SafeLogger.log('Skipping duplicate log entry by ID:', logEntry.id);
// Increment counter on existing entry
- let counter = parseInt(existingEntryById.dataset.counter || '1');
+ let counter = parseInt(existingEntryById.dataset.counter || '1', 10);
counter++;
existingEntryById.dataset.counter = counter;
@@ -828,7 +828,7 @@
SafeLogger.log('Skipping duplicate log entry by content:', message);
// Increment counter on existing entry
- let counter = parseInt(entry.dataset.counter || '1');
+ let counter = parseInt(entry.dataset.counter || '1', 10);
counter++;
entry.dataset.counter = counter;
@@ -887,7 +887,7 @@
function updateLogCounter(increment) {
const logIndicators = document.querySelectorAll('.ldr-log-indicator');
if (logIndicators.length > 0) {
- const currentCount = parseInt(logIndicators[0].textContent) || 0;
+ const currentCount = parseInt(logIndicators[0].textContent, 10) || 0;
const newCount = currentCount + increment;
// Update all indicators
diff --git a/src/local_deep_research/web/static/js/components/research.js b/src/local_deep_research/web/static/js/components/research.js
index 7acf200e07..d241db2ef5 100644
--- a/src/local_deep_research/web/static/js/components/research.js
+++ b/src/local_deep_research/web/static/js/components/research.js
@@ -817,7 +817,7 @@
const iterationsInput = document.getElementById('iterations');
if (iterationsInput) {
iterationsInput.addEventListener('change', function() {
- const iterations = parseInt(this.value);
+ const iterations = parseInt(this.value, 10);
SafeLogger.log('Iterations changed to:', iterations);
saveSearchSetting('search.iterations', iterations);
});
@@ -827,7 +827,7 @@
const questionsInput = document.getElementById('questions_per_iteration');
if (questionsInput) {
questionsInput.addEventListener('change', function() {
- const questions = parseInt(this.value);
+ const questions = parseInt(this.value, 10);
SafeLogger.log('Questions per iteration changed to:', questions);
saveSearchSetting('search.questions_per_iteration', questions);
});
@@ -2346,9 +2346,9 @@
// Get iterations and questions per iteration
const iterationsInput = document.getElementById('iterations');
- const iterations = iterationsInput ? parseInt(iterationsInput.value) : 2;
+ const iterations = iterationsInput ? parseInt(iterationsInput.value, 10) : 2;
const questionsInput = document.getElementById('questions_per_iteration');
- const questionsPerIteration = questionsInput ? parseInt(questionsInput.value) : 3;
+ const questionsPerIteration = questionsInput ? parseInt(questionsInput.value, 10) : 3;
// Prepare the data for submission
const formData = {
diff --git a/src/local_deep_research/web/static/js/components/subscription-manager.js b/src/local_deep_research/web/static/js/components/subscription-manager.js
index a069f9077f..381ee59d42 100644
--- a/src/local_deep_research/web/static/js/components/subscription-manager.js
+++ b/src/local_deep_research/web/static/js/components/subscription-manager.js
@@ -280,7 +280,7 @@ class SubscriptionManager {
// Handle save
document.getElementById('save-subscription-edit').addEventListener('click', async () => {
const updates = {
- refresh_interval_minutes: parseInt(document.getElementById('edit-frequency').value),
+ refresh_interval_minutes: parseInt(document.getElementById('edit-frequency').value, 10),
folder: document.getElementById('edit-folder').value,
notes: document.getElementById('edit-notes').value
};
diff --git a/src/local_deep_research/web/static/js/embedding_settings.js b/src/local_deep_research/web/static/js/embedding_settings.js
index 1c6904f68b..a2b3794d91 100644
--- a/src/local_deep_research/web/static/js/embedding_settings.js
+++ b/src/local_deep_research/web/static/js/embedding_settings.js
@@ -136,8 +136,8 @@ async function loadCurrentSettings() {
originalValues = {
'local_search_embedding_provider': document.getElementById('embedding-provider').value,
'local_search_embedding_model': document.getElementById('embedding-model').value,
- 'local_search_chunk_size': parseInt(document.getElementById('chunk-size').value) || 1000,
- 'local_search_chunk_overlap': parseInt(document.getElementById('chunk-overlap').value) || 200,
+ 'local_search_chunk_size': parseInt(document.getElementById('chunk-size').value, 10) || 1000,
+ 'local_search_chunk_overlap': parseInt(document.getElementById('chunk-overlap').value, 10) || 200,
'local_search_splitter_type': document.getElementById('splitter-type').value,
'local_search_distance_metric': document.getElementById('distance-metric').value,
'local_search_index_type': document.getElementById('index-type').value,
@@ -309,8 +309,8 @@ function refreshSavedDefaults() {
renderSavedDefaults({
embedding_provider: document.getElementById('embedding-provider').value,
embedding_model: document.getElementById('embedding-model').value,
- chunk_size: parseInt(document.getElementById('chunk-size').value) || 1000,
- chunk_overlap: parseInt(document.getElementById('chunk-overlap').value) || 200,
+ chunk_size: parseInt(document.getElementById('chunk-size').value, 10) || 1000,
+ chunk_overlap: parseInt(document.getElementById('chunk-overlap').value, 10) || 200,
splitter_type: document.getElementById('splitter-type').value,
distance_metric: document.getElementById('distance-metric').value,
index_type: document.getElementById('index-type').value,
@@ -346,7 +346,7 @@ function attachAutoSaveListeners() {
// Chunk size - blur / Enter
const chunkSizeEl = document.getElementById('chunk-size');
function saveChunkSize() {
- const value = parseInt(chunkSizeEl.value);
+ const value = parseInt(chunkSizeEl.value, 10);
if (isNaN(value) || value < 100 || value > 5000) return;
const oldValue = originalValues['local_search_chunk_size'];
saveSetting('local_search_chunk_size', value, 'Chunk size', oldValue);
@@ -359,7 +359,7 @@ function attachAutoSaveListeners() {
// Chunk overlap - blur / Enter
const chunkOverlapEl = document.getElementById('chunk-overlap');
function saveChunkOverlap() {
- const value = parseInt(chunkOverlapEl.value);
+ const value = parseInt(chunkOverlapEl.value, 10);
if (isNaN(value) || value < 0 || value > 1000) return;
const oldValue = originalValues['local_search_chunk_overlap'];
saveSetting('local_search_chunk_overlap', value, 'Chunk overlap', oldValue);
@@ -706,8 +706,8 @@ async function handleConfigSubmit(event) {
const formData = {
embedding_provider: provider,
embedding_model: document.getElementById('embedding-model').value,
- chunk_size: parseInt(document.getElementById('chunk-size').value),
- chunk_overlap: parseInt(document.getElementById('chunk-overlap').value),
+ chunk_size: parseInt(document.getElementById('chunk-size').value, 10),
+ chunk_overlap: parseInt(document.getElementById('chunk-overlap').value, 10),
splitter_type: document.getElementById('splitter-type').value,
distance_metric: document.getElementById('distance-metric').value,
index_type: document.getElementById('index-type').value,
@@ -845,7 +845,7 @@ async function testConfiguration() {
const data = await response.json();
if (data.success) {
- const responseTime = parseInt(data.response_time_ms);
+ const responseTime = parseInt(data.response_time_ms, 10);
const slowHint = responseTime > 3000
? '<br><i class="fas fa-info-circle"></i> <em>Slow response time may be due to initial model loading. Test again for a more accurate measurement.</em>'
: '';
diff --git a/src/local_deep_research/web/static/js/pages/news.js b/src/local_deep_research/web/static/js/pages/news.js
index 65f35685cb..004083d391 100644
--- a/src/local_deep_research/web/static/js/pages/news.js
+++ b/src/local_deep_research/web/static/js/pages/news.js
@@ -303,7 +303,7 @@ function setupEventListeners() {
if (impactValue) {
impactValue.textContent = e.target.value + '+';
}
- activeImpactThreshold = parseInt(e.target.value);
+ activeImpactThreshold = parseInt(e.target.value, 10);
renderNewsItems();
});
}
@@ -651,7 +651,7 @@ function parseAndDisplayTable(content) {
safeRenderHTML(tableBody, rows.map(row => {
// Check if we have an impact score column (usually second to last)
const impactIndex = row.length >= 7 ? 6 : (row.length >= 6 ? 5 : -1);
- const hasImpact = impactIndex > 0 && !isNaN(parseInt(row[impactIndex]));
+ const hasImpact = impactIndex > 0 && !isNaN(parseInt(row[impactIndex], 10));
return `
<tr>
@@ -1187,7 +1187,7 @@ function getPriorityClass(score) {
}
function getImpactClass(score) {
- const num = parseInt(score);
+ const num = parseInt(score, 10);
if (num >= 7) return 'impact-high';
if (num >= 4) return 'impact-medium';
return 'impact-low';
@@ -1494,7 +1494,7 @@ function createTableViewHTML() {
// Filter by impact
function filterNewsByImpact(threshold) {
- activeImpactThreshold = parseInt(threshold);
+ activeImpactThreshold = parseInt(threshold, 10);
updateFilterStatusBar();
renderNewsItems();
}
@@ -2039,7 +2039,7 @@ async function createSubscription() {
body: JSON.stringify({
query,
subscription_type: type,
- refresh_minutes: parseInt(refreshMinutes)
+ refresh_minutes: parseInt(refreshMinutes, 10)
})
});
@@ -3643,7 +3643,7 @@ async function handleNewsSubscriptionSubmit(e) {
body: JSON.stringify({
query,
subscription_type: 'search',
- refresh_minutes: parseInt(frequency),
+ refresh_minutes: parseInt(frequency, 10),
model_provider: modelProvider,
model,
search_strategy: searchStrategy
diff --git a/src/local_deep_research/web/static/js/research_form.js b/src/local_deep_research/web/static/js/research_form.js
index a1647facf4..81b98adcaf 100644
--- a/src/local_deep_research/web/static/js/research_form.js
+++ b/src/local_deep_research/web/static/js/research_form.js
@@ -107,8 +107,8 @@ function saveResearchSettings() {
'X-CSRFToken': csrfToken
},
body: JSON.stringify({
- 'search.iterations': parseInt(iterations),
- 'search.questions_per_iteration': parseInt(questions)
+ 'search.iterations': parseInt(iterations, 10),
+ 'search.questions_per_iteration': parseInt(questions, 10)
})
})
.then(response => response.json())
diff --git a/src/local_deep_research/web/static/js/services/socket.js b/src/local_deep_research/web/static/js/services/socket.js
index 43b0b66503..dc169e378a 100644
--- a/src/local_deep_research/web/static/js/services/socket.js
+++ b/src/local_deep_research/web/static/js/services/socket.js
@@ -533,7 +533,7 @@ window.socket = (function() {
// Update log count
const logIndicator = document.getElementById('log-indicator');
if (logIndicator) {
- const currentCount = parseInt(logIndicator.textContent) || 0;
+ const currentCount = parseInt(logIndicator.textContent, 10) || 0;
logIndicator.textContent = currentCount + 1;
}
}
@@ -940,7 +940,7 @@ if (!window.addConsoleLog) {
// Update log count
const logIndicator = document.getElementById('log-indicator');
if (logIndicator) {
- const currentCount = parseInt(logIndicator.textContent) || 0;
+ const currentCount = parseInt(logIndicator.textContent, 10) || 0;
logIndicator.textContent = currentCount + 1;
}
diff --git a/src/local_deep_research/web/static/js/utils/log-helpers.js b/src/local_deep_research/web/static/js/utils/log-helpers.js
index a2be24537d..14689ca5ea 100644
--- a/src/local_deep_research/web/static/js/utils/log-helpers.js
+++ b/src/local_deep_research/web/static/js/utils/log-helpers.js
@@ -116,9 +116,9 @@
// while preserving the time portion
if (dateStr !== mostCommonDate) {
const [year, month, day] = mostCommonDate.split('-');
- date.setFullYear(parseInt(year));
- date.setMonth(parseInt(month) - 1); // Months are 0-indexed
- date.setDate(parseInt(day));
+ date.setFullYear(parseInt(year, 10));
+ date.setMonth(parseInt(month, 10) - 1); // Months are 0-indexed
+ date.setDate(parseInt(day, 10));
// Update the log time
log.time = date.toISOString();
diff --git a/tests/accessibility_tests/wcag-compliance.spec.js b/tests/accessibility_tests/wcag-compliance.spec.js
index 965b05cae5..8339848393 100644
--- a/tests/accessibility_tests/wcag-compliance.spec.js
+++ b/tests/accessibility_tests/wcag-compliance.spec.js
@@ -55,7 +55,7 @@ test.describe('WCAG Compliance Tests', () => {
for (const heading of headings) {
const tagName = await heading.evaluate(el => el.tagName.toLowerCase());
- const level = parseInt(tagName.charAt(1));
+ const level = parseInt(tagName.charAt(1), 10);
// Only check for upward level skips (going deeper)
if (level > prevLevel) {
diff --git a/tests/api_tests_with_login/test_helpers.js b/tests/api_tests_with_login/test_helpers.js
index e146860638..e90b42ddc0 100644
--- a/tests/api_tests_with_login/test_helpers.js
+++ b/tests/api_tests_with_login/test_helpers.js
@@ -91,7 +91,7 @@ function executeCurl(command) {
// Extract status code
const statusMatch = statusLine.match(/HTTP\/[\d.]+ (\d+)/);
- const status = statusMatch ? parseInt(statusMatch[1]) : 0;
+ const status = statusMatch ? parseInt(statusMatch[1], 10) : 0;
return {
status,
diff --git a/tests/puppeteer/helpers/index.js b/tests/puppeteer/helpers/index.js
index 6c099b2447..a9931c4b9b 100644
--- a/tests/puppeteer/helpers/index.js
+++ b/tests/puppeteer/helpers/index.js
@@ -13,7 +13,7 @@ const fs = require('fs');
// Test configuration
const BASE_URL = process.env.TEST_URL || 'http://localhost:5000';
const HEADLESS = process.env.HEADLESS !== 'false';
-const SLOW_MO = parseInt(process.env.SLOW_MO) || 0;
+const SLOW_MO = parseInt(process.env.SLOW_MO, 10) || 0;
const CI_FAST_MODE = process.env.CI_FAST_MODE === 'true';
// In CI fast mode, reduce delays by 40% to speed up tests while keeping stability
diff --git a/tests/ui_tests/DEBUG_settings_mobile_fix.js b/tests/ui_tests/DEBUG_settings_mobile_fix.js
index a7dc057bce..a45e37c7bc 100644
--- a/tests/ui_tests/DEBUG_settings_mobile_fix.js
+++ b/tests/ui_tests/DEBUG_settings_mobile_fix.js
@@ -80,7 +80,7 @@ async function testSettingsMobileFix() {
// Check if height is reasonable (less than 5000px)
const isFixed = dimensions.mainContent &&
- parseInt(dimensions.mainContent.computedHeight) < 5000;
+ parseInt(dimensions.mainContent.computedHeight, 10) < 5000;
console.log(isFixed ? '✅ Height issue FIXED!' : '❌ Height issue persists');
diff --git a/tests/ui_tests/mobile/test_mobile_ui_comprehensive.js b/tests/ui_tests/mobile/test_mobile_ui_comprehensive.js
index 8c333f0886..e6c91ea2b5 100644
--- a/tests/ui_tests/mobile/test_mobile_ui_comprehensive.js
+++ b/tests/ui_tests/mobile/test_mobile_ui_comprehensive.js
@@ -233,7 +233,7 @@ class MobileUITester {
tests.modals.visible.push(modal.className);
// Check z-index
- const zIndex = parseInt(style.zIndex) || 0;
+ const zIndex = parseInt(style.zIndex, 10) || 0;
if (zIndex < 1000) {
tests.modals.zIndexIssues.push({
class: modal.className,
diff --git a/tests/ui_tests/playwright/tests/theme-visual-regression.spec.js b/tests/ui_tests/playwright/tests/theme-visual-regression.spec.js
index d45ec9c561..b6cf5f853f 100644
--- a/tests/ui_tests/playwright/tests/theme-visual-regression.spec.js
+++ b/tests/ui_tests/playwright/tests/theme-visual-regression.spec.js
@@ -114,9 +114,9 @@ test.describe('Theme Contrast - Text Readability', () => {
const match = rgbStr.match(/rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*([\d.]+))?\)/);
if (!match) return null;
return {
- r: parseInt(match[1]),
- g: parseInt(match[2]),
- b: parseInt(match[3]),
+ r: parseInt(match[1], 10),
+ g: parseInt(match[2], 10),
+ b: parseInt(match[3], 10),
a: match[4] !== undefined ? parseFloat(match[4]) : 1,
};
}
@@ -176,7 +176,7 @@ test.describe('Theme Contrast - Text Readability', () => {
function parseRgb(rgbStr) {
const match = rgbStr.match(/rgba?\((\d+),\s*(\d+),\s*(\d+)/);
if (!match) return null;
- return { r: parseInt(match[1]), g: parseInt(match[2]), b: parseInt(match[3]) };
+ return { r: parseInt(match[1], 10), g: parseInt(match[2], 10), b: parseInt(match[3], 10) };
}
/**
diff --git a/tests/ui_tests/test_autocomplete_selection.js b/tests/ui_tests/test_autocomplete_selection.js
index baa22fdd4d..edf5b4b3ea 100644
--- a/tests/ui_tests/test_autocomplete_selection.js
+++ b/tests/ui_tests/test_autocomplete_selection.js
@@ -14,7 +14,7 @@ const TEST_TIMEOUT = 30000;
const config = {
baseUrl: process.env.BASE_URL || 'http://127.0.0.1:5000',
headless: process.env.HEADLESS !== 'false',
- slowMo: parseInt(process.env.SLOW_MO || '0'),
+ slowMo: parseInt(process.env.SLOW_MO || '0', 10),
devtools: process.env.DEVTOOLS === 'true'
};
diff --git a/tests/ui_tests/test_context_overflow.js b/tests/ui_tests/test_context_overflow.js
index 486e7dd367..57c08acc3a 100644
--- a/tests/ui_tests/test_context_overflow.js
+++ b/tests/ui_tests/test_context_overflow.js
@@ -8,7 +8,7 @@ const AuthHelper = require('./auth_helper');
const BASE_URL = process.env.BASE_URL || 'http://127.0.0.1:5000';
const HEADLESS = process.env.HEADLESS !== 'false';
-const SLOW_MO = parseInt(process.env.SLOW_MO || '0');
+const SLOW_MO = parseInt(process.env.SLOW_MO || '0', 10);
describe('Context Overflow Dashboard Tests', () => {
let browser;
diff --git a/tests/ui_tests/test_context_overflow_standalone.js b/tests/ui_tests/test_context_overflow_standalone.js
index a1ef5f3e94..898213e038 100644
--- a/tests/ui_tests/test_context_overflow_standalone.js
+++ b/tests/ui_tests/test_context_overflow_standalone.js
@@ -10,7 +10,7 @@ const AuthHelper = require('./auth_helper');
const BASE_URL = process.env.BASE_URL || 'http://127.0.0.1:5000';
const HEADLESS = process.env.HEADLESS !== 'false';
-const SLOW_MO = parseInt(process.env.SLOW_MO || '100');
+const SLOW_MO = parseInt(process.env.SLOW_MO || '100', 10);
async function testContextOverflow() {
console.log('🚀 Starting Context Overflow Dashboard Test');
diff --git a/tests/ui_tests/test_settings_persistence.js b/tests/ui_tests/test_settings_persistence.js
index e48e1186fe..4cbc5c9f0a 100644
--- a/tests/ui_tests/test_settings_persistence.js
+++ b/tests/ui_tests/test_settings_persistence.js
@@ -188,15 +188,15 @@ async function verifySettingsPersistence(page, originalSettings) {
// Max tokens
const maxTokens = document.querySelector('input[name="llm.max_tokens"], #max-tokens');
- if (maxTokens) settings.maxTokens = parseInt(maxTokens.value);
+ if (maxTokens) settings.maxTokens = parseInt(maxTokens.value, 10);
// Iterations
const iterations = document.querySelector('input[name="search.iterations"], #search-iterations');
- if (iterations) settings.iterations = parseInt(iterations.value);
+ if (iterations) settings.iterations = parseInt(iterations.value, 10);
// Questions per iteration
const questions = document.querySelector('input[name="search.questions_per_iteration"], #questions-per-iteration');
- if (questions) settings.questionsPerIteration = parseInt(questions.value);
+ if (questions) settings.questionsPerIteration = parseInt(questions.value, 10);
// Citation format
const citation = document.querySelector('select[name="report.citation_format"], #citation-format');