Skip to content

escapeSequenceCasing

Reports escape sequences with lowercase hexadecimal characters.

✅ This rule is included in the ts stylisticStrict presets.

Enforces a consistent escaped value style by requiring escape sequence values to use uppercase hexadecimal characters. Uppercase characters promote readability by making the escaped value more distinguishable from the identifier.

const foo = "\xa9";
const foo = "\ud834";
const foo = "\u{1d306}";
const foo = "\ca";

This rule is not configurable.

If your codebase has an established convention of using lowercase escape sequences, or if you don’t care about the casing of escape sequences, you may disable this rule.

Made with ❤️‍🔥 in Boston by Josh Goldberg and contributors.