no-hex-escape

March 27, 2026 ยท View on GitHub

๐Ÿ“ Enforce the use of Unicode escapes instead of hexadecimal escapes.

๐Ÿ’ผ This rule is enabled in the following configs: โœ… recommended, โ˜‘๏ธ unopinionated.

๐Ÿ”ง This rule is automatically fixable by the --fix CLI option.

Enforces a convention of using Unicode escapes instead of hexadecimal escapes for consistency and clarity.

Examples

// โŒ
const foo = '\x1B';

// โœ…
const foo = '\u001B';
// โŒ
const foo = `\x1B${bar}`;

// โœ…
const foo = `\u001B${bar}`;