Skip to content

babel, typescript => Syntax error when using object destructing and return type annotation together on arrow function #12199

@07akioni

Description

@07akioni

Bug Report

  • I would like to work on a fix!

Current behavior

see

Syntax Error

Input Code

Case a

({ x, ...rest }): any => rest

Case b

({ a, b = [] }): any => {}

Expected behavior

No syntax error

See

Babel Configuration (babel.config.js, .babelrc, package.json#babel, cli command, .eslintrc)

see

Environment

see


  • Babel version(s): 7.12.1
  • Node/npm version: N/A
  • OS: Mac OS
  • Monorepo: no
  • How you are using Babel: N/A

Possible Solution

Additional context

Metadata

Metadata

Assignees

No one assigned

    Labels

    i: needs triageoutdatedA closed issue/PR that is archived due to age. Recommended to make a new issue

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions