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

What this checks for

  1. Masks string literals and comments so text examples do not produce edits.
  2. Finds variables initialized from new Intl.Locale(...) and simple aliases of those variables.
  3. Rewrites only member expressions on those receivers — not arbitrary property names.
  4. Counts each replacement and shows which line they happened on.
  5. Lists skipped lookalikes such as obj.calendars so 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];

see also