Skip to content
This repository has been archived by the owner on Aug 31, 2023. It is now read-only.

Normalize Big-Int literals #2426

Closed
Tracked by #2403
MichaReiser opened this issue Apr 13, 2022 · 0 comments
Closed
Tracked by #2403

Normalize Big-Int literals #2426

MichaReiser opened this issue Apr 13, 2022 · 0 comments
Assignees
Labels
A-Formatter Area: formatter Help wanted Help would be really appreciated

Comments

@MichaReiser
Copy link
Contributor

MichaReiser commented Apr 13, 2022

Prettier normalizes hex/octal/binary escape sequences whereas Rome doesn't Playground.

Report

Input

100n
9223372036854775807n
0o16432n
// 0O -> 0o
0O16432n
// FF -> ff
0xFFF123n
// 0X -> 0x
0XFFF123n
0b101011101n
// 0B -> 0b
0B101011101n
200_000n
// A -> a
0x0000_000An
0b0111_1111n

Prettier

100n;
9223372036854775807n;
0o16432n;
// 0O -> 0o
0o16432n;
// FF -> ff
0xfff123n;
// 0X -> 0x
0xfff123n;
0b101011101n;
// 0B -> 0b
0b101011101n;
200_000n;
// A -> a
0x0000_000an;
0b0111_1111n;

Rome

100n;
9223372036854775807n;
0o16432n;
// 0O -> 0o
0O16432n;
// FF -> ff
0xFFF123n;
// 0X -> 0x
0XFFF123n;
0b101011101n;
// 0B -> 0b
0B101011101n;
200_000n;
// A -> a
0x0000_000An;
0b0111_1111n;

Expected

Rome's formatting to match prettier's.

@MichaReiser MichaReiser added Help wanted Help would be really appreciated A-Formatter Area: formatter labels Apr 13, 2022
@xunilrj xunilrj self-assigned this Apr 19, 2022
@xunilrj xunilrj closed this as completed Apr 21, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
A-Formatter Area: formatter Help wanted Help would be really appreciated
Projects
Status: Done
Development

No branches or pull requests

2 participants