microsoft / microsoft/TypeScript

Comment like jsx text emitted twice when preserve enabled

Đang mở
#61,860 1 bình luận 0 reaction 0 người được giao Xem trên GitHub
Bug Domain: JSX/TSX Help Wanted
Ngôn ngữ chính
Go
Star
111k
Fork
14.3k
Merge trung bình
2 ngày 4 giờ
Pull request đã merge (30 ngày)
132

Mô tả

### 🔎 Search Terms

comment like jsx text, preserve jsx

### 🕗 Version & Regression Information

- This is the behavior in every version I tried, and I reviewed the FAQ for entries about _________

### ⏯ Playground Link

https://www.typescriptlang.org/play/?jsx=1#code/GYVwdgxgLglg9mABAQQA6oBQEpEG8C+AUMRAgM5SIBWZAHogLyIA8aqAfAPQBUiYcibp1w9EARkGdxAJgDMiUdMn5R-Sc05t2AbkJA

### 💻 Code

```tsx
function App() {}
const jsx = /* no */{/* 1 */ 123 /* 2 */}/* no */;
```

### 🙁 Actual behavior

These duplicate sections will be rendered in the JSX text output:

```jsx
"use strict";
function App() { }
const jsx = /* no *//* no */{/* 1 */123 /* 2 */} /* no *//* no */
// ~~~~~~~ ~~~~~~~
```

### 🙂 Expected behavior

```diff
"use strict";
function App() { }
- const jsx = /* no *//* no */{/* 1 */123 /* 2 */} /* no *//* no */
+ const jsx = /* no */{/* 1 */123 /* 2 */} /* no */
```

### Additional information about the issue

_No response_

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Hướng nghiên cứu

Bắt đầu với TypeScript Playground được liên kết và reproducer TSX sử dụng cách xử lý preserve JSX. So sánh văn bản JSX được phát ra với đầu ra dự kiến: mỗi chú thích /* no */ phải xuất hiện một lần thay vì bị trùng lặp.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
typescript
Lĩnh vực
compilers
Loại issue
Lỗi
Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức độ hoạt động
Đình trệ
Độ rõ ràng
Khá rõ ràng
Mức phù hợp với người mới
42/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.