Skip to content

Open-source agentic AI Search Execution Platform. Track AI visibility, find opportunities, and let agents turn signals into prioritized actions and drafted fixes across ChatGPT, Claude, Gemini, Google AI Overviews, Google AI Mode, Perplexity, Grok, and Microsoft Copilot.

chore(web): allow a locale-less Intl formatter only to read its resolvedOptions, with or without new (#1549 review) (#1555)

Cihan024e3c7ded9c
diff --git a/web/eslint.config.mjs b/web/eslint.config.mjs
index a0ea83682..b676cbd37 100644
--- a/web/eslint.config.mjs
+++ b/web/eslint.config.mjs
@@ -33,14 +33,11 @@ const eslintConfig = defineConfig([
message: "Name the locale: pass 'en-US' instead of [].",
},
// new Intl.NumberFormat(), Intl.NumberFormat(undefined, …), new Intl.Collator([]).
- // Intl.DateTimeFormat() alone reads the browser's time zone (lib/time-zone.ts).
- {
- selector: "NewExpression[callee.object.name='Intl'][arguments.length=0]",
- message: "Name the locale: pass 'en-US'.",
- },
+ // A formatter with no arguments only to read its resolvedOptions() (the
+ // browser's time zone, lib/time-zone.ts) formats nothing, with or without `new`.
{
selector:
- "CallExpression[callee.object.name='Intl'][callee.property.name!='DateTimeFormat'][arguments.length=0]",
+ ":matches(NewExpression, CallExpression)[callee.object.name='Intl'][arguments.length=0]:not(MemberExpression[property.name='resolvedOptions'] > .object)",
message: "Name the locale: pass 'en-US'.",
},
{