Skip to content

Unnecessary extra using @babel/plugin-proposal-object-rest-spread #5310

Closed
@alexander-akait

Description

@alexander-akait

Is this a bug report?

Unnecessary extra using @babel/plugin-proposal-object-rest-spread https://github.com/facebook/create-react-app/blob/master/packages/babel-preset-react-app/create.js#L113. In stable babel@7 release this problem was fixed. You can test with reproducible example below.

Did you try recovering your dependencies?

not required

Which terms did you search for in User Guide?

not required

Environment

no matter

(paste the output of the command here)

Steps to Reproduce

not required

Expected Behavior

Don't use unnecessary extra plugin

Actual Behavior

We are using this plugin.

Reproducible Demo

console.log(
  require('@babel/core').transform(
    `
const { ...rest1 } = {};
const [{ ...rest2 }] = [{}];
`,
    {
      plugins: ['@babel/plugin-proposal-object-rest-spread']
    }
  ).code
)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions