@godxjp/ui 16.9.3 → 16.9.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/scripts/ui-audit.mjs +6 -1
package/package.json
CHANGED
package/scripts/ui-audit.mjs
CHANGED
|
@@ -259,7 +259,12 @@ const RULES = [
|
|
|
259
259
|
{
|
|
260
260
|
id: "raw-intl-date",
|
|
261
261
|
severity: "warn",
|
|
262
|
-
|
|
262
|
+
// Only the unambiguously-Date methods: `.toLocaleDateString()` / `.toLocaleTimeString()`.
|
|
263
|
+
// Bare `.toLocaleString()` is excluded on purpose — it is overwhelmingly
|
|
264
|
+
// `Number.prototype.toLocaleString()` (legit locale number formatting), and matching it
|
|
265
|
+
// false-flagged every formatted count/amount. A date+time `Date.toLocaleString()` is rare and
|
|
266
|
+
// still partly covered by the hand-built `new Date(...).getMonth()+` alternative below.
|
|
267
|
+
test: /\.toLocale(?:Date|Time)String\(\s*\)|new Date\([^)]*\)\.(?:getMonth|getDate|getFullYear)\(\)\s*\+/,
|
|
263
268
|
standard: "ISO 8601 · IANA tz database · ECMA-402 Intl.DateTimeFormat",
|
|
264
269
|
message:
|
|
265
270
|
"Don't hand-build or locale-default dates. Use formatDate from @godxjp/ui/datetime (Intl.DateTimeFormat + IANA timezone + ISO-8601), which respects the AppProvider locale/timezone.",
|