Update eslint config to ignore file,

fix some type error on LiveSyncBaseCore
This commit is contained in:
vorotamoroz
2026-05-13 10:15:45 +01:00
parent 053813bffb
commit 8deaf123d6
2 changed files with 14 additions and 8 deletions

View File

@@ -33,6 +33,10 @@ export default defineConfig([
".prettierrc.*.mjs", ".prettierrc.*.mjs",
".prettierrc.mjs", ".prettierrc.mjs",
"*.config.mjs", "*.config.mjs",
"src/apps/**/*",
"src/lib/src/services/implements/browser/**",
"src/lib/src/services/implements/headless/**",
"src/lib/src/API",
]), ]),
...sveltePlugin.configs["flat/base"], ...sveltePlugin.configs["flat/base"],
...obsidianmd.configs.recommended, ...obsidianmd.configs.recommended,

View File

@@ -1,4 +1,5 @@
import { LOG_LEVEL_INFO } from "octagonal-wheels/common/logger"; import { LOG_LEVEL_INFO } from "octagonal-wheels/common/logger";
import type PouchDB from "pouchdb-core";
import type { SimpleStore } from "octagonal-wheels/databases/SimpleStoreBase"; import type { SimpleStore } from "octagonal-wheels/databases/SimpleStoreBase";
import type { HasSettings, ObsidianLiveSyncSettings, EntryDoc } from "./lib/src/common/types"; import type { HasSettings, ObsidianLiveSyncSettings, EntryDoc } from "./lib/src/common/types";
import { __$checkInstanceBinding } from "./lib/src/dev/checks"; import { __$checkInstanceBinding } from "./lib/src/dev/checks";
@@ -34,12 +35,11 @@ export class LiveSyncBaseCore<
TCommands extends IMinimumLiveSyncCommands = IMinimumLiveSyncCommands, TCommands extends IMinimumLiveSyncCommands = IMinimumLiveSyncCommands,
> >
implements implements
LiveSyncLocalDBEnv, LiveSyncLocalDBEnv,
LiveSyncReplicatorEnv, LiveSyncReplicatorEnv,
LiveSyncJournalReplicatorEnv, LiveSyncJournalReplicatorEnv,
LiveSyncCouchDBReplicatorEnv, LiveSyncCouchDBReplicatorEnv,
HasSettings<ObsidianLiveSyncSettings> HasSettings<ObsidianLiveSyncSettings> {
{
addOns = [] as TCommands[]; addOns = [] as TCommands[];
/** /**
@@ -123,7 +123,7 @@ export class LiveSyncBaseCore<
for (const module of this.modules) { for (const module of this.modules) {
if (module.constructor === constructor) return module as T; if (module.constructor === constructor) return module as T;
} }
throw new Error(`Module ${constructor} not found or not loaded.`); throw new Error(`Module ${constructor.name} not found or not loaded.`);
} }
/** /**
@@ -160,8 +160,10 @@ export class LiveSyncBaseCore<
module.onBindFunction(this, this.services); module.onBindFunction(this, this.services);
__$checkInstanceBinding(module); // Check if all functions are properly bound, and log warnings if not. __$checkInstanceBinding(module); // Check if all functions are properly bound, and log warnings if not.
} else { } else {
// module should not be never.
const moduleName = (module as unknown)?.constructor?.name ?? "unknown";
this.services.API.addLog( this.services.API.addLog(
`Module ${(module as any)?.constructor?.name ?? "unknown"} does not have onBindFunction, skipping binding.`, `Module ${moduleName} does not have onBindFunction, skipping binding.`,
LOG_LEVEL_INFO LOG_LEVEL_INFO
); );
} }