babel/packages/babel-preset-env/data/shipped-proposals.js
James Beavers 80aa7dc3c6 Add optional-chaining and nullish-coalescing to preset-env (#10811)
* Add support for optional-chaining (stage 4) in present-env

* revert babel-preset-env built-in-modules.json

* add shipped proposal syntax map entry, optional chaining

* update remaining syntax plugin references, proposal description

* Add support for nullish coalescing operator in preset-env

* selectively enable sort-keys rule

* enforce sort-keys on shipped-proposals

* don't use Object.entries()

* Update fixtures
2020-01-10 22:07:43 +01:00

25 lines
963 B
JavaScript

/* eslint sort-keys: "error" */
// These mappings represent the syntax proposals that have been
// shipped by browsers, and are enabled by the `shippedProposals` option.
const proposalPlugins = {};
// use intermediary object to enforce alphabetical key order
const pluginSyntaxObject = {
"proposal-async-generator-functions": "syntax-async-generators",
"proposal-json-strings": "syntax-json-strings",
"proposal-nullish-coalescing-operator": "syntax-nullish-coalescing-operator",
"proposal-object-rest-spread": "syntax-object-rest-spread",
"proposal-optional-catch-binding": "syntax-optional-catch-binding",
"proposal-optional-chaining": "syntax-optional-chaining",
"proposal-unicode-property-regex": null,
};
const pluginSyntaxEntries = Object.keys(pluginSyntaxObject).map(function (key) {
return [key, pluginSyntaxObject[key]];
});
const pluginSyntaxMap = new Map(pluginSyntaxEntries);
module.exports = { pluginSyntaxMap, proposalPlugins };