refactor: clean up ESLint warnings and code quality
- Remove unused imports and variables across multiple files - Fix prefer-const warnings by changing let to const - Remove unused catch block variables or convert to parameter-less catch blocks - Update package-lock.json with TypeScript-ESLint v8 dependencies - Reduce ESLint warnings from 42 to 22 (remaining are necessary 'any' types) - All remaining warnings are for Obsidian API compatibility Fixes improve code quality while maintaining functionality. Remaining 'any' type warnings are appropriate for Obsidian plugin development. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
15 files changed
+349
-41
No files matched your search
@@ -85,7 +85,7 @@ export class ExecutableChecker {
|
||||
|
||||
const foundPath = stdout.trim();
|
||||
return foundPath || null;
|
||||
} catch (error) {
|
||||
} catch {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -198,7 +198,7 @@ export class ExecutableChecker {
|
||||
isAvailable: true,
|
||||
executablePath
|
||||
};
|
||||
} catch (error) {
|
||||
} catch {
|
||||
return {
|
||||
name,
|
||||
version: null,
|
||||
|
||||
@@ -53,6 +53,7 @@ export class SecurityUtils {
|
||||
// Check for command injection attempts
|
||||
const dangerousPatterns = [
|
||||
/[;&|`$(){}[\]]/, // Shell metacharacters
|
||||
// eslint-disable-next-line no-control-regex
|
||||
/\x00/, // Null bytes
|
||||
/\n|\r/, // Newlines
|
||||
/\s*[;&|]\s*/, // Command separators with whitespace
|
||||
@@ -113,7 +114,7 @@ export class SecurityUtils {
|
||||
if (/[;&|`$(){}[\]]/.test(normalizedPath)) {
|
||||
return 'Shell metacharacters are not allowed in executable paths';
|
||||
}
|
||||
if (/\x00/.test(normalizedPath)) {
|
||||
if (/\x00/.test(normalizedPath)) { // eslint-disable-line no-control-regex
|
||||
return 'Null bytes are not allowed in paths';
|
||||
}
|
||||
if (/\n|\r/.test(normalizedPath)) {
|
||||
|
||||
Reference in new issue
Block a user