You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Enable the @typescript-eslint/no-non-null-assertion ESLint rule
What
Turns on @typescript-eslint/no-non-null-assertion at error level, forbidding the non-null assertion operator (value!).
Why
The ! operator asserts to the type checker that a value is notnull/undefined while providing no runtime guarantee. When the assumption is wrong, TypeScript stays silent at compile time and the code crashes at runtime (Cannot read properties of null) — exactly the class of bug the type system is supposed to prevent. Banning ! forces an explicit guard, optional chaining, or proper narrowing, so null-safety is enforced rather than assumed.
eslint-config-agent does not ship this rule, so non-null assertions were previously unchecked.
Scope
One existing violation in src/app/open/use-auto-close.ts (a clearInterval(intervalRef.current!)) — the file already has a null-checked clearTimer() helper, so the assertion can be replaced with a safe guarded call.
Implemented in the accompanying PR. pnpm lint, tsc --noEmit, and next build all pass.
No other rules are changed.
This issue was opened by the Add lint rule → issue + PR (owned repos + my orgs) → Slack routine of moadim. cc @tupe12334
Activity
github-actions commentedon Jun 18, 2026
A workspace is ready for this issue.
Powered by Worktree · Install