[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'.
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");