Skip to content

Latest commit

Β 

History

History
30 lines (20 loc) Β· 915 Bytes

File metadata and controls

30 lines (20 loc) Β· 915 Bytes

no-hex-escape

πŸ“ 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}`;