refactor: replace explicit any types for Obsidian plugin review compliance

Replace all @typescript-eslint/no-explicit-any warnings with proper type assertions
and union types to meet Obsidian plugin review requirements.

Changes:
- Replace (adapter as any).basePath with (adapter as { basePath: string }).basePath
- Change template variable types from Record<string, any> to Record<string, string | number | boolean>
- Change frontmatter types from Record<string, any> to Record<string, unknown>
- Fix error handling in PdfCliExecutor with proper type assertion
- Update method signatures in TypstVariableMapper for type safety

This eliminates all 42 @typescript-eslint/no-explicit-any warnings while
maintaining full functionality and improving type safety.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Jarvis committed 2025-09-10 18:04:29 +02:00
1 parent 9345198337
commit c13e48a615
14 files changed
+22 -22

No files matched your search

+3 -3
View File
@@ -13,7 +13,7 @@ export interface ExportConfig {
/** Override output folder */
outputFolder?: string;
/** Template variables for this export */
templateVariables?: Record<string, any>;
templateVariables?: Record<string, string | number | boolean>;
/** Open PDF after export */
openAfterExport?: boolean;
/** Preserve folder structure when exporting */
@@ -59,9 +59,9 @@ export interface ValidationResult {
export interface ModalState {
settings: ExportConfigModalSettings;
templateVariables: Record<string, any>;
templateVariables: Record<string, string | number | boolean>;
updateSettings(updates: Partial<ExportConfigModalSettings>): void;
updateTemplateVariables(updates: Record<string, any>): void;
updateTemplateVariables(updates: Record<string, string | number | boolean>): void;
buildExportConfig(): ExportConfig;
notifyChange(): void;
setProgress(percent: number, operation: string): void;
+3 -3
View File
@@ -8,7 +8,7 @@ import { ExportFormat, obsidianTypstPDFExportSettings } from '../../../core/sett
export class ModalState implements IModalState {
settings: ExportConfigModalSettings;
templateVariables: Record<string, any>;
templateVariables: Record<string, string | number | boolean>;
private changeListeners: Set<() => void> = new Set();
private static readonly STORAGE_KEY = 'typst-export-modal-state';
@@ -64,7 +64,7 @@ export class ModalState implements IModalState {
/**
* Update template variables
*/
updateTemplateVariables(updates: Record<string, any>): void {
updateTemplateVariables(updates: Record<string, string | number | boolean>): void {
this.templateVariables = {
...this.templateVariables,
...updates
@@ -198,7 +198,7 @@ export class ModalState implements IModalState {
/**
* Load state from localStorage
*/
private loadFromStorage(): { settings: Partial<ExportConfigModalSettings>, templateVariables: Record<string, any> } | null {
private loadFromStorage(): { settings: Partial<ExportConfigModalSettings>, templateVariables: Record<string, string | number | boolean> } | null {
try {
const saved = localStorage.getItem(ModalState.STORAGE_KEY);
if (saved) {