From e3369e03b5f4be640907462c946cac4368709550 Mon Sep 17 00:00:00 2001 From: Antigravity Date: Thu, 28 May 2026 21:18:51 +0000 Subject: [PATCH] fix(eslint): resolve TypeScript imports require lint rules and prefer-const warnings --- memento-note/components/structured-view-block-embed.tsx | 4 ++-- .../components/structured-views/notes-structured-table.tsx | 4 ++-- memento-note/eslint.config.mjs | 4 ++++ memento-note/extension/i18n/generate-translations.cjs | 1 + 4 files changed, 9 insertions(+), 4 deletions(-) diff --git a/memento-note/components/structured-view-block-embed.tsx b/memento-note/components/structured-view-block-embed.tsx index 1d1e36b..6526e75 100644 --- a/memento-note/components/structured-view-block-embed.tsx +++ b/memento-note/components/structured-view-block-embed.tsx @@ -420,8 +420,8 @@ export function StructuredViewBlockEmbed({ setEchoLoading(false) return } - let res = await fetch(`/api/notes?search=${encodeURIComponent(q)}&limit=5`) - let json = await res.json() + const res = await fetch(`/api/notes?search=${encodeURIComponent(q)}&limit=5`) + const json = await res.json() let data = (json.success && Array.isArray(json.data)) ? json.data : [] diff --git a/memento-note/components/structured-views/notes-structured-table.tsx b/memento-note/components/structured-views/notes-structured-table.tsx index a341d9e..f1f3daa 100644 --- a/memento-note/components/structured-views/notes-structured-table.tsx +++ b/memento-note/components/structured-views/notes-structured-table.tsx @@ -141,8 +141,8 @@ export function NotesStructuredTable({ return } - let fallbackRes = await fetch(`/api/notes?search=${encodeURIComponent(q)}&limit=5`) - let fallbackJson = await fallbackRes.json() + const fallbackRes = await fetch(`/api/notes?search=${encodeURIComponent(q)}&limit=5`) + const fallbackJson = await fallbackRes.json() let filteredNotes = (fallbackJson.success && Array.isArray(fallbackJson.data)) ? fallbackJson.data.filter((n: any) => n.id !== noteId) diff --git a/memento-note/eslint.config.mjs b/memento-note/eslint.config.mjs index 185dc07..daafdc5 100644 --- a/memento-note/eslint.config.mjs +++ b/memento-note/eslint.config.mjs @@ -6,6 +6,7 @@ const require = createRequire(import.meta.url); // Manually configure Next.js ESLint without React Compiler plugin const nextWebVitals = require("eslint-config-next/core-web-vitals"); const nextTypeScript = require("eslint-config-next/typescript"); +const reactHooks = require("eslint-plugin-react-hooks"); // React Compiler rules to disable (from eslint-plugin-react-hooks v5+) // See: https://react.dev/learn/react-compiler @@ -54,6 +55,9 @@ const eslintConfig = defineConfig([ "tests/**", ]), { + plugins: { + "react-hooks": reactHooks, + }, rules: { ...reactCompilerRules, "react-hooks/rules-of-hooks": "error", diff --git a/memento-note/extension/i18n/generate-translations.cjs b/memento-note/extension/i18n/generate-translations.cjs index 536786d..9ea8178 100644 --- a/memento-note/extension/i18n/generate-translations.cjs +++ b/memento-note/extension/i18n/generate-translations.cjs @@ -1,4 +1,5 @@ #!/usr/bin/env node +/* eslint-disable @typescript-eslint/no-require-imports */ 'use strict' const fs = require('fs')