babel / babel/website

Example in “plugin-transform-property-literals” documentation is wrong

Open
#2,186 3 comments 0 reactions 0 assignees View on GitHub
docs
Dominant language
TypeScript
Stars
777
Forks
1.4k
Avg merge
16h 45m
Merged PRs (30d)
3

Description

@babel/plugin-transform-property-literals will add quotes for key which name is es3 reserved word. A correct example:

IN
```JavaScript
var foo = {
// changed
default: 1,
abstract: 2,

// not changed
"bar": function () {},
"1": function () {},

[a]: 2,
foo: 1
};
```

out
```JavaScript
var foo = {
// changed
"default": 1,
"abstract": 2,
// not changed
"bar": function bar() {},
"1": function _() {},
[a]: 2,
foo: 1
};
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.