chore: apply oxlint autofix (safe level)

Auto-fixed 102 warnings (6040 → 5938) across 57 files. Main categories:
- preserve-caught-error: add { cause: error } to re-thrown errors
- unicorn/no-array-reverse: .reverse() → .toReversed()
- unicorn/no-useless-fallback-in-spread: drop unnecessary ?? {} in spreads
- oxc/no-map-spread: rewrite object spread in .map() to Object.assign
- react-hooks/exhaustive-deps: trim module-level constants from dep arrays

Ran npm run format after to clean up whitespace from lint mutations.
This commit is contained in:
Mohamed Boudra
2026-04-23 21:47:36 +07:00
parent 9c88850de0
commit 177153e5e8
57 changed files with 152 additions and 151 deletions
@@ -227,7 +227,7 @@ export function useAudioRecorder(config?: AudioCaptureConfig) {
if (error?.message !== "Recording cancelled") {
console.error("[AudioRecorder] Failed to start recording:", error);
}
throw new Error(`Failed to start audio recording: ${error.message}`);
throw new Error(`Failed to start audio recording: ${error.message}`, { cause: error });
}
}, [recordingOptions.sampleRate, recordingOptions.numberOfChannels, recordingOptions.bitRate]);
@@ -293,7 +293,7 @@ export function useAudioRecorder(config?: AudioCaptureConfig) {
} catch (error: any) {
setRecordingStartTime(null);
console.error("[AudioRecorder] Failed to stop recording:", error);
throw new Error(`Failed to stop audio recording: ${error.message}`);
throw new Error(`Failed to stop audio recording: ${error.message}`, { cause: error });
} finally {
startStopMutexRef.current = null;
}
@@ -190,7 +190,7 @@ export function useAudioRecorder(config?: AudioCaptureConfig) {
try {
stream = await navigator.mediaDevices.getUserMedia(constraints);
} catch (error: any) {
throw new Error(`Failed to access microphone: ${error?.message ?? error}`);
throw new Error(`Failed to access microphone: ${error?.message ?? error}`, { cause: error });
}
try {
@@ -225,7 +225,9 @@ export function useAudioRecorder(config?: AudioCaptureConfig) {
recorder = new MediaRecorder(stream, recorderOptions);
} catch (error: any) {
cleanupStream();
throw new Error(`Failed to initialize recorder: ${error?.message ?? error}`);
throw new Error(`Failed to initialize recorder: ${error?.message ?? error}`, {
cause: error,
});
}
mediaRecorderRef.current = recorder;