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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user