demo · v143 · deprecation
Codemod helper
TC39 changed all the locale info accessors from getters (locale.calendars) to methods (locale.getCalendars()). Old code keeps reading the property — which Chrome 143 still serves with a deprecation warning, but will eventually remove. This page is a one-shot codemod: paste any source file, get a patched version, see every hit.
The rewrite tokenizes the source, masks strings and comments, records variables initialized from new Intl.Locale(...), then rewrites only those typed receivers. Untyped lookalikes are reported but left alone.
before — uses getters
after — uses methods
Paste source and hit rewrite.
The 7 Chrome-deprecated accessors
.calendars→.getCalendars().collations→.getCollations().hourCycles→.getHourCycles().numberingSystems→.getNumberingSystems().textInfo→.getTextInfo().timeZones→.getTimeZones().weekInfo→.getWeekInfo()
What this checks for
- Masks string literals and comments so text examples do not produce edits.
- Finds variables initialized from
new Intl.Locale(...)and simple aliases of those variables. - Rewrites only member expressions on those receivers — not arbitrary property names.
- Counts each replacement and shows which line they happened on.
- Lists skipped lookalikes such as
obj.calendarsso you can review them manually.
// before
const cal = locale.calendars[0];
const hc = locale.hourCycles[0];
// after — works today and after the getters are removed
const cal = locale.getCalendars()[0];
const hc = locale.getHourCycles()[0];