Skip to content
Open
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
13 changes: 12 additions & 1 deletion eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,15 @@ const urlConstantsOverride = {
},
};

export default [...config, urlConstantsOverride];
// Forbid non-null assertions (`value!`). The `!` operator silently tells the
// type checker a value can't be null/undefined without any runtime guarantee,
// so a wrong assumption surfaces as a runtime crash instead of a compile error.
// `eslint-config-agent` does not ship this rule. Prefer an explicit guard,
// optional chaining, or narrowing instead.
const noNonNullAssertion = {
rules: {
"@typescript-eslint/no-non-null-assertion": "error",
},
};

export default [...config, urlConstantsOverride, noNonNullAssertion];
3 changes: 1 addition & 2 deletions src/app/open/use-auto-close.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,7 @@ export function useAutoClose(active: boolean) {
intervalRef.current = setInterval(() => {
setCountdown((prev) => {
if (prev <= 1) {
clearInterval(intervalRef.current!);
intervalRef.current = null;
clearTimer();
window.close();
return 0;
}
Expand Down
Loading