Skip to content

Latest commit

 

History

History
37 lines (25 loc) · 569 Bytes

number-literal-case.md

File metadata and controls

37 lines (25 loc) · 569 Bytes

Enforce lowercase identifier and uppercase value for number literals

Enforces a convention of defining number literals where the literal identifier is written in lowercase and the value in uppercase. Differentiating the casing of the identifier and value clearly separates them and makes your code more readable.

This rule is fixable.

Fail

const foo = 0XFF;
const foo = 0xff;
const foo = 0Xff;
const foo = 0B11;
const foo = 0O10;

Pass

const foo = 0xFF;
const foo = 0b11;
const foo = 0o10;