Example in “plugin-transform-property-literals” documentation is wrong
@babel/plugin-transform-property-literals will add quotes for key which name is es3 reserved word. A correct example:
IN
var foo = {
// changed
default: 1,
abstract: 2,
// not changed
"bar": function () {},
"1": function () {},
[a]: 2,
foo: 1
};
out
var foo = {
// changed
"default": 1,
"abstract": 2,
// not changed
"bar": function bar() {},
"1": function _() {},
[a]: 2,
foo: 1
};
Hey @d3pi! We really appreciate you taking the time to report an issue. The collaborators on this project attempt to help as many people as possible, but we're a limited number of volunteers, so it's possible this won't be addressed swiftly.
If you need any help, or just have general Babel or JavaScript questions, we have a vibrant Slack community that typically always has someone willing to help. You can sign-up here for an invite.
Dp you want to open a PR? :pray:
Hi everyone.
I see the example is correct in this link:
https://babeljs.io/docs/en/babel-plugin-transform-property-literals#example
But incorrect in this link:
https://github.com/babel/minify/tree/master/packages/babel-plugin-transform-property-literals
and incorrect one is inside minify repo.