Fix ESLint configuration and resolve all linting issues

- Rename eslint.config.js to eslint.config.mjs to support ES modules
- Remove unused parameters from interface implementations
- Fix refs access during render in WorkflowStepper by removing redundant check
- Wrap colorBlocks computation in useMemo to fix exhaustive-deps warning

All linting errors and warnings are now resolved.

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

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
Jan-Henrik Bruhn 2025-12-11 14:11:35 +01:00
parent 75ec5c49a9
commit 3516b609f6
6 changed files with 47 additions and 47 deletions

View file

@ -1,4 +1,4 @@
import { useRef, useEffect, useState } from "react";
import { useRef, useEffect, useState, useMemo } from "react";
import {
CheckCircleIcon,
ArrowRightIcon,
@ -58,8 +58,9 @@ export function ProgressMonitor({
: 0;
// Calculate color block information from pesData
const colorBlocks = pesData
? (() => {
const colorBlocks = useMemo(() => {
if (!pesData) return [];
const blocks: Array<{
colorIndex: number;
threadHex: string;
@ -103,8 +104,7 @@ export function ProgressMonitor({
}
return blocks;
})()
: [];
}, [pesData]);
// Determine current color block based on current stitch
const currentStitch = sewingProgress?.currentStitch || 0;

View file

@ -375,7 +375,7 @@ export function WorkflowStepper({
</div>
{/* Popover */}
{showPopover && popoverStep !== null && stepRefs.current[popoverStep] && (
{showPopover && popoverStep !== null && (
<div
ref={popoverRef}
className="absolute top-full mt-4 left-1/2 transform -translate-x-1/2 w-full max-w-xl z-50 animate-fadeIn"

View file

@ -23,7 +23,7 @@ export class BrowserFileService implements IFileService {
});
}
async saveFileDialog(_data: Uint8Array, _defaultName: string): Promise<void> {
async saveFileDialog(): Promise<void> {
// No-op in browser - could implement download if needed in the future
console.warn('saveFileDialog not implemented in browser');
}

View file

@ -4,7 +4,7 @@ import type { IFileService } from '../interfaces/IFileService';
* Electron implementation of file service using native dialogs via IPC
*/
export class ElectronFileService implements IFileService {
async openFileDialog(_options: { accept: string }): Promise<File | null> {
async openFileDialog(): Promise<File | null> {
if (!window.electronAPI) {
throw new Error('Electron API not available');
}

View file

@ -68,7 +68,7 @@ export class ElectronStorageService implements IStorageService {
}
}
async hasPattern(_uuid: string): Promise<boolean> {
async hasPattern(): Promise<boolean> {
// Since this is async in Electron, we can't truly implement this synchronously
// Returning false as a safe default
console.warn('[ElectronStorage] hasPattern called synchronously, returning false');