Migrate web to ESLint 10 flat config (#24326)

* migrate web to eslint 10 flat config

ESLint 10 dropped `.eslintrc` support, so `.eslintrc.cjs` is replaced with `eslint.config.js` and the lint scripts no longer pass `--ext` or `--ignore-path`. typescript-eslint moves to 8, react-hooks to 7, and react-refresh to 0.5, and the unused jest and vitest-globals plugins are removed. Lint behaves as it did before: catch variables aren't checked, unused disable directives aren't reported, and rules newly added to the recommended sets are off until the code passes them. typescript-eslint 8 flags constants used only in `typeof`, so those are now exported, or replaced with a union type where the export would trip react-refresh.

* fix lint findings from the eslint 10 recommended rules

Remove the rule overrides from the flat config migration and fix what they were hiding. Unused catch bindings are dropped, 20 disable directives that suppressed nothing are removed (react-hooks 5.2 and 7.1.1 report identical exhaustive-deps findings with inline config ignored), dead initial values are dropped, short-circuit calls become if statements or optional calls, rethrown errors pass `cause`, and the disabled "No recordings" tooltip in `ReviewTimeline` is removed along with its memo and the `getRecordingAvailability` prop. The 3 react-refresh warnings for files that export contexts or classes are left for a later refactor.
This commit is contained in:
Josh Hawkins
2026-09-14 07:53:45 -06:00
committed by GitHub
parent acc740a976
commit caa6edecac
59 changed files with 1125 additions and 1256 deletions
@@ -35,7 +35,7 @@ export function GenericVideoPlayer({
// missing media is a 404; 502 still covers a failed or
// unreachable mapping request, which is equally unplayable
setSourceExists(response.status !== 502 && response.status !== 404);
} catch (error) {
} catch {
setSourceExists(false);
}
};
+1 -1
View File
@@ -203,7 +203,7 @@ export default function JSMpegPlayer({
try {
videoElement.player?.destroy();
// eslint-disable-next-line no-empty
} catch (e) {}
} catch {}
if (videoWrapper) {
videoWrapper.innerHTML = "";
+3 -3
View File
@@ -357,7 +357,7 @@ function MSEPlayer({
if (originalHandler) {
try {
originalHandler(msg);
} catch (e) {
} catch {
// Don't reject - we got the response, just let the error bubble
}
}
@@ -478,7 +478,7 @@ function MSEPlayer({
msRef.current?.setLiveSeekableRange(end, end + 15);
}
}
} catch (e) {
} catch {
// no-op
}
});
@@ -497,7 +497,7 @@ function MSEPlayer({
} else {
try {
sb?.appendBuffer(data as ArrayBuffer);
} catch (e) {
} catch {
// no-op
}
}
@@ -249,9 +249,6 @@ function PreviewVideoPlayer({
previewRef.current?.load();
}, 1000);
setChangeoverTimeout(timeout);
// we only want this to change when current preview changes
// eslint-disable-next-line react-hooks/exhaustive-deps
},
[setCurrentHourFrame, videoSize],
);
@@ -147,8 +147,6 @@ export default function VideoControls({
} else {
return MdVolumeUp;
}
// only update when specific fields change
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [volume, muted]);
const onKeyboardShortcut = useCallback(
+1 -1
View File
@@ -118,7 +118,7 @@ export default function WebRtcPlayer({
? await navigator.mediaDevices.getUserMedia(constraints)
: await navigator.mediaDevices.getDisplayMedia(constraints);
return stream.getTracks();
} catch (e) {
} catch {
return [];
}
}