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.

fix: switch ESLint pre-commit from mirrors-eslint to local hook (#3402)

LearningCircuit1a1190a618f9
diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml
index 6aeb810d1c..3f61a822f3 100644
--- a/.pre-commit-config.yaml
+++ b/.pre-commit-config.yaml
@@ -34,17 +34,17 @@ repos:
- id: shellcheck
name: Shellcheck - lint shell scripts
description: "Shell script static analysis tool"
-- repo: https://github.com/pre-commit/mirrors-eslint
- rev: 6b0a6fbdd14ed9625d6475c2523f325db6f6637a # v9.39.1 (frozen)
+# ESLint runs as a local hook so it resolves plugins from the project's
+# node_modules (mirrors-eslint installs into its own cache, which flat
+# config's `import` cannot reach). Requires `npm install` first.
+- repo: local
hooks:
- id: eslint
name: ESLint - lint JavaScript
+ entry: npx eslint --config eslint.config.js
+ language: system
files: \.(js|mjs)$
exclude: (node_modules|dist|build|\.min\.js|static/dist)
- args: ['--config', 'eslint.config.js']
- additional_dependencies:
- repo: https://github.com/astral-sh/ruff-pre-commit
# Ruff version.
rev: aca6d4c8045a504e2812ea4bedff1d0a09e437bc # v0.15.8 (frozen)
diff --git a/src/local_deep_research/database/session_context.py b/src/local_deep_research/database/session_context.py
index e2ebc2e74c..b42de90db8 100644
--- a/src/local_deep_research/database/session_context.py
+++ b/src/local_deep_research/database/session_context.py
@@ -38,7 +38,11 @@ def get_g_db_session() -> Optional[Session]:
only check out a pool connection when a route actually needs one.
Returns None if no user is authenticated or DB is not connected.
"""
- if has_app_context() and hasattr(g, "db_session") and g.db_session is not None:
+ if (
+ has_app_context()
+ and hasattr(g, "db_session")
+ and g.db_session is not None
+ ):
return g.db_session
username = getattr(g, "current_user", None) if has_app_context() else None
if not username or not db_manager.is_user_connected(username):
diff --git a/src/local_deep_research/web/routes/research_routes.py b/src/local_deep_research/web/routes/research_routes.py
index 9f3d7fb98f..472458d479 100644
--- a/src/local_deep_research/web/routes/research_routes.py
+++ b/src/local_deep_research/web/routes/research_routes.py
@@ -503,7 +503,9 @@ def start_research():
db_session_for_settings.commit()
except Exception:
db_session_for_settings.rollback()
- settings_manager = SettingsManager(db_session_for_settings, owns_session=False)
+ settings_manager = SettingsManager(
+ db_session_for_settings, owns_session=False
+ )
# Get all current settings as a snapshot (bypass cache to ensure fresh data)
all_settings = settings_manager.get_all_settings(bypass_cache=True)
diff --git a/tests/news/test_storage_manager.py b/tests/news/test_storage_manager.py
index 41be5dd643..e038b322ab 100644
--- a/tests/news/test_storage_manager.py
+++ b/tests/news/test_storage_manager.py
@@ -12,7 +12,7 @@ Tests cover:
"""
import pytest
-from unittest.mock import Mock, patch, MagicMock
+from unittest.mock import Mock, patch
class TestStorageManagerInit: