Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/islands/ToolHost.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,12 @@
export default function ToolHost({ toolId }: ToolHostProps) {
const tool = getToolById(toolId);

// `tool` is a stable registry reference derived from `toolId`, so keying on
// both is equivalent to keying on `toolId` alone — and satisfies the linter.
const LazyTool = useMemo(() => {
if (!tool) return null;
return lazy(tool.load);
}, [toolId]);
}, [toolId, tool]);

Check warning on line 56 in src/islands/ToolHost.tsx

View workflow job for this annotation

GitHub Actions / Test · Build · Lint

React Hook useMemo has an unnecessary dependency: 'toolId'. Either exclude it or remove the dependency array

if (!tool || !LazyTool) {
return <div className="py-12 text-center text-muted-foreground">Tool not found.</div>;
Expand Down
2 changes: 1 addition & 1 deletion src/islands/dev/HotkeyTest.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export default function HotkeyTest() {
const registerTestHotkey = async (keys: string, description: string) => {
setError(null);
try {
const id = await hotkeyService.register(
await hotkeyService.register(
keys,
() => {
setLastTriggered(`${description} (${keys})`);
Expand Down
4 changes: 3 additions & 1 deletion src/islands/dev/JsonCompare.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import { CheckCircle2, XCircle } from 'lucide-react';

// Deep equality check ignoring object property order
function deepEqual(a: any, b: any, ignoreArrayOrder: boolean = true): boolean {

Check warning on line 7 in src/islands/dev/JsonCompare.tsx

View workflow job for this annotation

GitHub Actions / Test · Build · Lint

Unexpected any. Specify a different type

Check warning on line 7 in src/islands/dev/JsonCompare.tsx

View workflow job for this annotation

GitHub Actions / Test · Build · Lint

Unexpected any. Specify a different type
if (a === b) return true;

if (a == null || b == null) return a === b;
Expand Down Expand Up @@ -45,7 +45,7 @@
}

// Find differences between two objects
function findDifferences(a: any, b: any, ignoreArrayOrder: boolean = true, path: string = ''): string[] {

Check warning on line 48 in src/islands/dev/JsonCompare.tsx

View workflow job for this annotation

GitHub Actions / Test · Build · Lint

Unexpected any. Specify a different type

Check warning on line 48 in src/islands/dev/JsonCompare.tsx

View workflow job for this annotation

GitHub Actions / Test · Build · Lint

Unexpected any. Specify a different type
const diffs: string[] = [];

if (a === b) return diffs;
Expand All @@ -68,7 +68,7 @@
if (ignoreArrayOrder) {
// Find unmatched elements (order-independent comparison)
const bCopy = [...b];
const unmatchedA: any[] = [];

Check warning on line 71 in src/islands/dev/JsonCompare.tsx

View workflow job for this annotation

GitHub Actions / Test · Build · Lint

Unexpected any. Specify a different type

for (let i = 0; i < a.length; i++) {
const matchIdx = bCopy.findIndex(bVal => deepEqual(a[i], bVal, ignoreArrayOrder));
Expand Down Expand Up @@ -129,8 +129,8 @@
export default function JsonCompare() {
const [leftJson, setLeftJson] = useState('');
const [rightJson, setRightJson] = useState('');
const [leftParsed, setLeftParsed] = useState<any>(null);

Check warning on line 132 in src/islands/dev/JsonCompare.tsx

View workflow job for this annotation

GitHub Actions / Test · Build · Lint

Unexpected any. Specify a different type
const [rightParsed, setRightParsed] = useState<any>(null);

Check warning on line 133 in src/islands/dev/JsonCompare.tsx

View workflow job for this annotation

GitHub Actions / Test · Build · Lint

Unexpected any. Specify a different type
const [leftError, setLeftError] = useState('');
const [rightError, setRightError] = useState('');
const [isEqual, setIsEqual] = useState<boolean | null>(null);
Expand All @@ -149,7 +149,7 @@
return;
}

let parsedLeft: any = null;

Check warning on line 152 in src/islands/dev/JsonCompare.tsx

View workflow job for this annotation

GitHub Actions / Test · Build · Lint

Unexpected any. Specify a different type
let parsedRight: any = null;

// Parse left
Expand Down Expand Up @@ -195,11 +195,13 @@
parseAndCompare(leftJson, value);
};

// Re-compare when ignoreArrayOrder changes
// Re-compare only when ignoreArrayOrder toggles; edits to left/right already
// trigger a compare via their change handlers, so they're intentionally omitted.
useEffect(() => {
if (leftJson.trim() && rightJson.trim()) {
parseAndCompare(leftJson, rightJson);
}
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [ignoreArrayOrder]);

return (
Expand Down
1 change: 0 additions & 1 deletion src/islands/dev/PasswordGen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ export default function PasswordGen() {
// Regenerate whenever any option changes.
useEffect(() => {
setPassword(generatePassword({ length, enabled, avoidAmbiguous, minNumbers, minSpecial }));
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [length, enabled, avoidAmbiguous, minNumbers, minSpecial]);

const clampMin = (value: number) => setMinLength(Math.min(Math.max(value || 1, 1), maxLength));
Expand Down
1 change: 0 additions & 1 deletion src/islands/draw/Whiteboard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,6 @@ export default function Whiteboard() {
window.removeEventListener('pagehide', flushSave);
window.removeEventListener('beforeunload', onBeforeUnload);
};
// eslint-disable-next-line react-hooks/exhaustive-deps
}, []);

useEffect(() => {
Expand Down
2 changes: 0 additions & 2 deletions src/islands/image/ImageAnnotate.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -478,7 +478,6 @@ export default function ImageAnnotate() {
takePendingImage().then(pending => {
if (pending) onDrop([new File([pending.blob], pending.name, { type: pending.blob.type })]);
});
// eslint-disable-next-line react-hooks/exhaustive-deps
}, []);

const pointer = (e: { clientX: number; clientY: number }) => {
Expand Down Expand Up @@ -759,7 +758,6 @@ export default function ImageAnnotate() {
window.addEventListener('keydown', onKey);
return () => window.removeEventListener('keydown', onKey);
// undo/redo use functional state updaters, so a stable listener is fine.
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [textEdit]);

const toPngBlob = async (): Promise<Blob> => {
Expand Down
2 changes: 1 addition & 1 deletion src/islands/image/ObjectRemove.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ export default function ObjectRemove() {

usePasteImage(f => onDrop([f]));

useEffect(() => { if (ready) redraw(); /* eslint-disable-next-line */ }, [ready]);
useEffect(() => { if (ready) redraw(); }, [ready]);

const pointer = (e: React.PointerEvent) => {
const c = viewRef.current!;
Expand Down
1 change: 0 additions & 1 deletion src/islands/playground/CodeScratchpad.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import { Button } from '@/components/ui/Button';
import MonacoEditor from './MonacoEditor';
import { extensionToLanguage } from '@/tools/playground/language.lib';
import { loadFiles, saveFiles, type ScratchFile } from '@/tools/playground/scratchpad.store';
import { downloadService } from '@/services/download';
import { fileService } from '@/services/file';
import { clipboardService } from '@/services/clipboard';

Expand Down
2 changes: 1 addition & 1 deletion src/services/file.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export class FileService {
return Array.from(source);
}

async getFileHandle(file: File): Promise<FileSystemFileHandle | null> {
async getFileHandle(_file: File): Promise<FileSystemFileHandle | null> {
// File System Access API - may not be available
if (!('showOpenFilePicker' in window)) {
return null;
Expand Down
2 changes: 1 addition & 1 deletion src/services/platform/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export function getPlatform(): Platform {
export function getArchitecture(): Architecture {
if (typeof window === 'undefined') return 'unknown';

// @ts-ignore - navigator.userAgentData is experimental
// @ts-expect-error - navigator.userAgentData is experimental
const uaData = navigator.userAgentData;

if (uaData && uaData.platform) {
Expand Down
2 changes: 1 addition & 1 deletion src/stores/worker.store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@ export function setProgress(id: string, label: string, percent: number): void {

export function removeProgress(id: string): void {
const current = progressMap.get();
const { [id]: removed, ...rest } = current;
const { [id]: _removed, ...rest } = current;
progressMap.set(rest);
}
Loading