fix: resolve all ESLint errors (lint now exits 0)

- useAppKeyboard: move all logic inside useEffect, fixes refs-in-render
  and no-unused-expressions for view mode shortcut handler
- SettingsPanel: refactor to inner component to fix setState-in-effect;
  remove unused maskKey function
- NoteList: remove re-exports (consumers import from noteListHelpers directly);
  fix no-unused-expressions in toggleGroup; eslint-disable for Icon-in-render
- useNoteActions: eslint-disable tabsRef.current assignment (valid pattern)
- Test files: fix no-explicit-any in useKeyboardNavigation, useSettings,
  useVaultLoader, wikilinks tests; update NoteList.test import path
This commit is contained in:
lucaronin
2026-02-23 08:53:43 +01:00
parent f476897d5e
commit efd79e9a3d
9 changed files with 74 additions and 79 deletions

View File

@@ -19,10 +19,10 @@ const savedSettings: Settings = {
let mockSettingsStore: Settings = { ...defaultSettings }
const mockInvokeFn = vi.fn((cmd: string, args?: any): Promise<any> => {
const mockInvokeFn = vi.fn((cmd: string, args?: Record<string, unknown>): Promise<unknown> => {
if (cmd === 'get_settings') return Promise.resolve({ ...mockSettingsStore })
if (cmd === 'save_settings') {
mockSettingsStore = { ...args.settings }
mockSettingsStore = { ...(args as { settings: Settings }).settings }
return Promise.resolve(null)
}
return Promise.resolve(null)
@@ -34,7 +34,7 @@ vi.mock('@tauri-apps/api/core', () => ({
vi.mock('../mock-tauri', () => ({
isTauri: () => false,
mockInvoke: (cmd: string, args?: any) => mockInvokeFn(cmd, args),
mockInvoke: (cmd: string, args?: Record<string, unknown>) => mockInvokeFn(cmd, args),
}))
describe('useSettings', () => {