Consider {"15831515641881813735": "foo"}. disallowQuotedKeysInObjects will flag an error here and insist that you write {15831515641881813735: "foo"} instead (and --fix will make this change). But, these are NOT equivalent because Javascript numbers lose precision after 52 bits, and this number uses a full 64 bits. You can see what happens on the Chrome dev console:
Consider
{"15831515641881813735": "foo"}
. disallowQuotedKeysInObjects will flag an error here and insist that you write{15831515641881813735: "foo"}
instead (and--fix
will make this change). But, these are NOT equivalent because Javascript numbers lose precision after 52 bits, and this number uses a full 64 bits. You can see what happens on the Chrome dev console:Notice the last three digits have been rounded to zero!
Or to make it ever more obvious:
disallowQuotedKeysInObjects should ignore numeric strings that can't be represented in a double-precision float.