← All recipes
Moderne licensed

Modernize octal escape sequences

Recipe IDorg.openrewrite.javascript.migrate.es6.modernize-octal-escape-sequencesArtifact@openrewrite/rewrite

Convert old-style octal escape sequences (e.g., \0, \123) to modern hex escape sequences (e.g., \x00, \x53) or Unicode escape sequences (e.g., \u0000, \u0053).

Single recipeMSAL

Usage

This recipe has no required configuration options. You’ll need the Moderne CLI configured before running the command below.

mod run . --recipe org.openrewrite.javascript.migrate.es6.modernize-octal-escape-sequences

If the recipe isn’t available locally, install it with:

mod config recipes npm install @openrewrite/rewrite

Options

NameTypeDescription
useUnicodeEscapesUse Unicode escape sequences (\uXXXX) instead of hex escape sequences (\xXX). Default is false.
e.g. true