Skip to content

Latest commit

 

History

History
35 lines (24 loc) · 546 Bytes

number-literal-case.md

File metadata and controls

35 lines (24 loc) · 546 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.

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;