Update ESLint rules and resolve bot review feedback #8
@@ -9,7 +9,7 @@
|
||||
* - Consistent error messaging and logging
|
||||
* - Batch export result tracking and reporting
|
||||
* - User-facing notices with appropriate durations
|
||||
* - Support for different log levels (error, warn, info)
|
||||
* - Support for different log levels (error, warn, debug)
|
||||
* - Specialized handlers for different error types (dependency, processing, validation)
|
||||
*/
|
||||
|
||||
@@ -43,7 +43,7 @@ export interface ExportError {
|
||||
operation: string;
|
||||
error: Error | string;
|
||||
shouldShowNotice?: boolean;
|
||||
logLevel?: 'error' | 'warn' | 'info';
|
||||
logLevel?: 'error' | 'warn' | 'debug';
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -180,7 +180,7 @@ export class ExportErrorHandler {
|
||||
case 'warn':
|
||||
console.warn(`${operation}:`, error);
|
||||
|
|
||||
break;
|
||||
case 'info':
|
||||
case 'debug':
|
||||
console.debug(`${operation}:`, error);
|
||||
break;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user
⚠️ Potential issue | 🟡 Minor
Align logLevel parameter with actual logging behavior.
The
logLevelparameter accepts'info'per the interface definition (line 46), but the implementation now usesconsole.debug()instead ofconsole.info(). This creates a semantic mismatch where callers specify'info'but receive debug-level logging.Consider one of these options:
console.info()if info-level logging is the intended behavior, OR'debug'instead of'info'to match the implementationOption 1: Revert to console.info
Option 2: Update interface and documentation
📝 Committable suggestion
🤖 Prompt for AI Agents
✅ Addressed in commits
f0daebctoc1c02ee@coderabbitai ObsidianReviewBot raised this issue:
🧩 Analysis chain
🏁 Script executed:
Length of output: 72
🏁 Script executed:
Length of output: 28847
@AlexKucera, thank you for clarifying! That makes sense—ObsidianReviewBot's restriction to only
console.warn,console.error, andconsole.debugmeans we need to align the interface with the implementation.Since no code in the codebase is currently using
logLevel: 'info'(confirmed by the search), you only need to update:ExportErrorinterface:(This is fine as-is, but you could optionally clarify it accepts 'error' | 'warn' | 'debug')
to remain as 'warn' (already correct), but the comment text that mentions "info" in the example doesn't exist, so you're good there.
The change from
console.info()toconsole.debug()is the right approach given the ObsidianReviewBot constraint. Just update the interface definition to match! 🎯🧬 Code Graph Analysis Results
tests/mocks/obsidian.ts
At lines 4-6: ``` export class Notice { constructor(message: string) {} } ```src/core/constants.ts
At lines 122-128: ``` export const EXPORT_CONSTANTS = { DEFAULT_TIMEOUT: 120000, // 2 minutes NOTICE_DURATION: { SHORT: 5000, LONG: 12000 } } as const; ```✏️ Learnings added