diff --git a/oxlint.config.ts b/oxlint.config.ts index b5ae6efc3a99..f22f6611a221 100644 --- a/oxlint.config.ts +++ b/oxlint.config.ts @@ -589,7 +589,7 @@ const config = defineConfig({ '@tanstack/query/no-void-query-fn': 'error', '@tanstack/query/mutation-property-order': 'error', 'react/capitalized-calls': 'error', - 'react/error-boundaries': 'off', // TODO(ryan953): Fix violations and promote this warning to an error. + 'react/error-boundaries': 'error', 'react/exhaustive-effect-dependencies': 'off', // TODO(ryan953): Fix violations and promote this warning to an error. 'react/function-component-definition': 'error', 'react/globals': 'off', // TODO(ryan953): Fix violations and promote this warning to an error. diff --git a/static/app/components/seer/markdown/embeds/components/resourceLink.tsx b/static/app/components/seer/markdown/embeds/components/resourceLink.tsx index 44caaa7008a8..10fe680c0ec7 100644 --- a/static/app/components/seer/markdown/embeds/components/resourceLink.tsx +++ b/static/app/components/seer/markdown/embeds/components/resourceLink.tsx @@ -21,6 +21,7 @@ import { } from 'sentry/icons'; import type {SVGIconProps} from 'sentry/icons/svgIcon'; import {isSafeHref} from 'sentry/utils/marked/marked'; +import {safeURL} from 'sentry/utils/url/safeURL'; /** * Every data type Seer surfaces as a resource link @@ -82,23 +83,22 @@ export function ResourceLink({ ); if (/^https?:\/\//.test(href) && isSafeHref(href)) { - try { - const parsed = new URL(href); - if (parsed.origin !== window.location.origin) { - return ( - - {icon} {title} - - ); - } + const parsed = safeURL(href); + if (!parsed) { + return null; + } + if (parsed.origin !== window.location.origin) { return ( - + {icon} {title} - + ); - } catch { - return null; } + return ( + + {icon} {title} + + ); } if (/^\/[^/]/.test(href)) {