babel / babel/website

@babel/plugin-syntax-jsx and @babel/plugin-syntax-typescript on REPL does not respect tsx contents

Open
#2,285 5 comments 0 reactions 0 assignees View on GitHub
repl
Dominant language
TypeScript
Stars
777
Forks
1.4k
Avg merge
16h 45m
Merged PRs (30d)
3

Description

## Bug Report

- [ ] I would like to work on a fix!

**Current behavior**
```
/repl.js: Unexpected token, expected "," (4:14)

2 |
3 | export function A() {
> 4 | return


| ^
5 | }
6 |
```

**Input Code**

[Minimum reproduction sample on REPL](https://babeljs.io/repl#?browsers=defaults%2C%20not%20ie%2011%2C%20not%20ie_mob%2011&build=&builtIns=false&spec=false&loose=false&code_lz=JYWwDg9gTgLgBAJQKYEMDG8BmUIjgIilQ3wChSkAPSWOTAVwDsNgJG4BBACgEo4BvUnDhEY9KOwA8AE2AA3OAHoAfKQC-pIA&debug=false&forceAllTransforms=false&shippedProposals=false&circleciRepo=&evaluate=false&fileSize=false&timeTravel=false&sourceType=module&lineWrap=false&presets=env&prettier=false&targets=&version=7.10.3&externalPlugins=%40babel%2Fplugin-syntax-jsx%407.10.1%2C%40babel%2Fplugin-syntax-typescript%407.10.1).

```js
import React from "react"

export function A() {
return


}
```

**Expected behavior**
Nothing happens.

**Babel Configuration (babel.config.js, .babelrc, package.json#babel, cli command, .eslintrc)**
- Filename: `babel.config.js`

```js
{
"plugins": [
"@babel/plugin-syntax-jsx",
"@babel/plugin-syntax-typescript"
]
}
```

**Environment**
- Babel version(s): 7.10.3
- Node/npm version: N/A. Issue reproducible on REPL.
- OS: N/A
- Monorepo: no
- How you are using Babel: N/A

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.