[babel 8] chore: do not push objectRestSpread parser option (#12607)

Co-authored-by: Nicolò Ribaudo <nicolo.ribaudo@gmail.com>
This commit is contained in:
Huáng Jùnliàng 2021-01-12 04:46:52 -05:00 committed by GitHub
parent cba64f9a09
commit e004a91566
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -31,12 +31,12 @@ export default declare((api, { isTSX }) => {
// in TS depends on the extensions, and is purely dependent on 'isTSX'. // in TS depends on the extensions, and is purely dependent on 'isTSX'.
removePlugin(plugins, "jsx"); removePlugin(plugins, "jsx");
parserOpts.plugins.push( parserOpts.plugins.push("typescript", "classProperties");
"typescript",
"classProperties", if (!process.env.BABEL_8_BREAKING) {
// TODO: This is enabled by default now, remove in Babel 8 // This is enabled by default since @babel/parser 7.1.5
"objectRestSpread", parserOpts.plugins.push("objectRestSpread");
); }
if (isTSX) { if (isTSX) {
parserOpts.plugins.push("jsx"); parserOpts.plugins.push("jsx");