Skip to main content

no-window-confirm

window.confirm() should use a confirmation dialog.

SeverityDimensionFiles
ErrorConsistency.tsx .jsx .ts

What it flags

A line like this:

if (window.confirm('Delete this preset?')) remove(id)

is reported as:

window.confirm() — use a ConfirmDialog component instead

How to fix it

Replace with a design system confirmation dialog.

preset AI suggests a fix: Replace window.confirm() with ConfirmDialog. Browser confirm dialogs block the UI and cannot be styled. Use a Dialog component with confirm/cancel actions.

Before:

if (window.confirm('Delete this preset?')) remove(id)

After:

// Use a confirmation dialog component
const confirmed = await showConfirmDialog({
  title: "Are you sure?",
  confirmText: "Confirm",
});

Was this page helpful?

Last reviewed by @jschuyler
All systems operationalDocsDevelopersPlatformPricing
PrivacyTerms© 2026 fndd, LLC