New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Re-generate preset-env fixtures #11016
Merged
JLHwung
merged 3 commits into
babel:master
from
nicolo-ribaudo:update-env-fixtures-ordering
Jan 16, 2020
Merged
Changes from 2 commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,67 +1,61 @@ | ||
/* eslint sort-keys: "error" */ | ||
|
||
module.exports = { | ||
"proposal-async-generator-functions": "Asynchronous Iterators", | ||
"proposal-json-strings": "JSON superset", | ||
"proposal-nullish-coalescing-operator": "nullish coalescing operator (??)", | ||
"proposal-object-rest-spread": "object rest/spread properties", | ||
"proposal-optional-catch-binding": "optional catch binding", | ||
"proposal-optional-chaining": "optional chaining operator (?.)", | ||
"proposal-unicode-property-regex": "RegExp Unicode Property Escapes", | ||
const es5 = { | ||
"transform-member-expression-literals": | ||
"Object/array literal extensions / Reserved words as property names", | ||
"transform-property-literals": | ||
"Object/array literal extensions / Reserved words as property names", | ||
"transform-reserved-words": "Miscellaneous / Unreserved words", | ||
}; | ||
|
||
const es2015 = { | ||
"transform-template-literals": { | ||
features: ["template literals"], | ||
}, | ||
"transform-literals": { | ||
features: ["Unicode code point escapes"], | ||
}, | ||
"transform-function-name": { | ||
features: ['function "name" property'], | ||
}, | ||
"transform-arrow-functions": { | ||
features: ["arrow functions"], | ||
}, | ||
|
||
"transform-async-to-generator": { | ||
features: ["async functions"], | ||
}, | ||
|
||
"transform-block-scoped-functions": { | ||
features: ["block-level function declaration"], | ||
}, | ||
"transform-block-scoping": { | ||
features: ["const", "let"], | ||
}, | ||
"transform-classes": { | ||
features: ["class", "super"], | ||
}, | ||
"transform-computed-properties": { | ||
features: ["object literal extensions / computed properties"], | ||
"transform-object-super": { | ||
features: ["super"], | ||
}, | ||
"transform-destructuring": { | ||
features: ["destructuring, assignment", "destructuring, declarations"], | ||
"transform-shorthand-properties": { | ||
features: ["object literal extensions / shorthand properties"], | ||
}, | ||
|
||
// We want to apply this prior to unicode regex so that "." and "u" | ||
// are properly handled. | ||
// | ||
// Ref: https://github.com/babel/babel/pull/7065#issuecomment-395959112 | ||
"transform-dotall-regex": "s (dotAll) flag for regular expressions", | ||
|
||
"transform-duplicate-keys": { | ||
features: ["miscellaneous / duplicate property names in strict mode"], | ||
}, | ||
"transform-exponentiation-operator": { | ||
features: ["exponentiation (**) operator"], | ||
"transform-computed-properties": { | ||
features: ["object literal extensions / computed properties"], | ||
}, | ||
"transform-for-of": { | ||
features: ["for..of loops"], | ||
}, | ||
"transform-function-name": { | ||
features: ['function "name" property'], | ||
}, | ||
"transform-literals": { | ||
features: ["Unicode code point escapes"], | ||
"transform-sticky-regex": { | ||
features: [ | ||
'RegExp "y" and "u" flags / "y" flag, lastIndex', | ||
'RegExp "y" and "u" flags / "y" flag', | ||
], | ||
}, | ||
"transform-member-expression-literals": | ||
"Object/array literal extensions / Reserved words as property names", | ||
"transform-named-capturing-groups-regex": "RegExp named capture groups", | ||
"transform-new-target": { | ||
features: ["new.target"], | ||
"transform-unicode-regex": { | ||
features: [ | ||
'RegExp "y" and "u" flags / "u" flag, case folding', | ||
'RegExp "y" and "u" flags / "u" flag, Unicode code point escapes', | ||
'RegExp "y" and "u" flags / "u" flag, non-BMP Unicode characters', | ||
'RegExp "y" and "u" flags / "u" flag', | ||
], | ||
}, | ||
"transform-object-super": { | ||
features: ["super"], | ||
"transform-spread": { | ||
features: ["spread syntax for iterable objects"], | ||
}, | ||
"transform-parameters": { | ||
features: [ | ||
|
@@ -70,36 +64,66 @@ module.exports = { | |
"destructuring, parameters / defaults, arrow function", | ||
], | ||
}, | ||
"transform-property-literals": | ||
"Object/array literal extensions / Reserved words as property names", | ||
"transform-regenerator": { | ||
features: ["generators"], | ||
"transform-destructuring": { | ||
features: ["destructuring, assignment", "destructuring, declarations"], | ||
}, | ||
"transform-reserved-words": "Miscellaneous / Unreserved words", | ||
"transform-shorthand-properties": { | ||
features: ["object literal extensions / shorthand properties"], | ||
"transform-block-scoping": { | ||
features: ["const", "let"], | ||
}, | ||
"transform-spread": { | ||
features: "spread syntax for iterable objects", | ||
"transform-typeof-symbol": { | ||
features: ["Symbol / typeof support"], | ||
}, | ||
"transform-sticky-regex": { | ||
features: [ | ||
'RegExp "y" and "u" flags / "y" flag, lastIndex', | ||
'RegExp "y" and "u" flags / "y" flag', | ||
], | ||
"transform-new-target": { | ||
features: ["new.target"], | ||
}, | ||
"transform-template-literals": { | ||
features: ["template literals"], | ||
"transform-regenerator": { | ||
features: ["generators"], | ||
}, | ||
"transform-typeof-symbol": { | ||
features: ["Symbol / typeof support"], | ||
}; | ||
|
||
const es2016 = { | ||
"transform-exponentiation-operator": { | ||
features: ["exponentiation (**) operator"], | ||
}, | ||
"transform-unicode-regex": { | ||
features: [ | ||
'RegExp "y" and "u" flags / "u" flag, case folding', | ||
'RegExp "y" and "u" flags / "u" flag, Unicode code point escapes', | ||
'RegExp "y" and "u" flags / "u" flag, non-BMP Unicode characters', | ||
'RegExp "y" and "u" flags / "u" flag', | ||
], | ||
}; | ||
|
||
const es2017 = { | ||
"transform-async-to-generator": { | ||
features: ["async functions"], | ||
}, | ||
}; | ||
|
||
const es2018 = { | ||
"proposal-async-generator-functions": "Asynchronous Iterators", | ||
"proposal-object-rest-spread": "object rest/spread properties", | ||
|
||
// We want to apply this prior to unicode regex so that "." and "u" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't think the order of regex-related plugins still matters since they are essentially feature flags now, the |
||
// are properly handled. | ||
// | ||
// Ref: https://github.com/babel/babel/pull/7065#issuecomment-395959112 | ||
"transform-dotall-regex": "s (dotAll) flag for regular expressions", | ||
"proposal-unicode-property-regex": "RegExp Unicode Property Escapes", | ||
"transform-named-capturing-groups-regex": "RegExp named capture groups", | ||
}; | ||
|
||
const es2019 = { | ||
"proposal-json-strings": "JSON superset", | ||
"proposal-optional-catch-binding": "optional catch binding", | ||
}; | ||
|
||
const es2020 = { | ||
"proposal-nullish-coalescing-operator": "nullish coalescing operator (??)", | ||
"proposal-optional-chaining": "optional chaining operator (?.)", | ||
}; | ||
|
||
// Run plugins for modern features first | ||
module.exports = Object.assign( | ||
{}, | ||
es2020, | ||
es2019, | ||
es2018, | ||
es2017, | ||
es2016, | ||
es2015, | ||
es5 | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would be good to add a comment here if the key order will impact the plugin execution order of preset-env.