alert()/confirm() used for UX
Part of Code Quality & Syntax, which counts for 20% of the overall score. When this check fires it deducts 2 points from that category, once per scan, no matter how many places it turns up.
What it detects
Native alert()/confirm() dialogs are jarring and block the main thread; use in-app UI for errors and confirmations.
Why it matters
alert() and confirm() freeze the whole page until dismissed, cannot be styled or translated with the rest of the app, and are hard to test. Browsers may also suppress them inside iframes or after repeated use, so a confirmation you rely on for a destructive action may simply never appear.
How to fix it
Replace alert() with your app's toast or notification component, and confirm() with a modal dialog component that exposes explicit confirm and cancel handlers (or returns a promise). If the project has no such components, build one small dialog on your UI library, for example a Radix AlertDialog in React, instead of reaching for the native dialogs.
The paid report includes a ready-to-paste prompt for your AI coding agent for every check it finds, pointed at the exact findings from your scan. See pricing
Does your repo trip this check?
Paste a GitHub URL or drop a project folder. Scans run in your browser and take seconds.
Scan your repo