jdavisclark / JsFormat

Javascript formatting for Sublime Text 2 & 3
1.42k stars 222 forks source link

JsFormat improperly formats BigInt literals #193

Closed sgerace closed 2 years ago

sgerace commented 3 years ago

I'm currently using JsFormat v2019.01.20.01.35.14 with Sublime Text v3.2.2, Build 3211 and if I attempt to format a file containing BigInt literals, for example:

let x = 1n;

it splits the "1" from the "n" into:

let x = 1 n;

which is invalid syntax.

pavelvasev commented 3 years ago

Same for a?.b syntax, jsFormat transforms it to a ? .b which is incorrect.

bitwiseman commented 3 years ago

This is fixed in the upstream library. It just needs updating here.

pavelvasev commented 3 years ago

Thank you @bitwiseman!

sgerace commented 2 years ago

It's been almost a year since this was first reported and the upstream library was updated in May (see https://github.com/beautify-web/js-beautify/issues/1934). Any chance we can get an updated release? Thanks!

sgerace commented 2 years ago

I've created a pull request to incorporate the latest version of js-beautify, which I've confirmed addresses this issue.