From e004a915667dfc0bb4fb453ecc9e9a8b11a686ad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hu=C3=A1ng=20J=C3=B9nli=C3=A0ng?= Date: Tue, 12 Jan 2021 04:46:52 -0500 Subject: [PATCH] [babel 8] chore: do not push `objectRestSpread` parser option (#12607) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Nicolò Ribaudo --- packages/babel-plugin-syntax-typescript/src/index.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/packages/babel-plugin-syntax-typescript/src/index.js b/packages/babel-plugin-syntax-typescript/src/index.js index c4c5eddaa27b..bc396d99bcae 100644 --- a/packages/babel-plugin-syntax-typescript/src/index.js +++ b/packages/babel-plugin-syntax-typescript/src/index.js @@ -31,12 +31,12 @@ export default declare((api, { isTSX }) => { // in TS depends on the extensions, and is purely dependent on 'isTSX'. removePlugin(plugins, "jsx"); - parserOpts.plugins.push( - "typescript", - "classProperties", - // TODO: This is enabled by default now, remove in Babel 8 - "objectRestSpread", - ); + parserOpts.plugins.push("typescript", "classProperties"); + + if (!process.env.BABEL_8_BREAKING) { + // This is enabled by default since @babel/parser 7.1.5 + parserOpts.plugins.push("objectRestSpread"); + } if (isTSX) { parserOpts.plugins.push("jsx");