microsoft / microsoft/TypeScript
Comment like jsx text emitted twice when preserve enabled
- Lenguaje dominante
- Go
- Estrellas
- 111k
- Forks
- 14.3k
- Merge medio
- 2 d 4 h
- PR fusionados (30 d)
- 132
Descripción
### 🔎 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_
Guía de contribución
Línea de trabajo
Comienza con el TypeScript Playground enlazado y el reproductor TSX usando el manejo de preserve JSX. Compara el texto JSX emitido con la salida esperada: cada comentario /* no */ debería aparecer una vez en lugar de duplicado.
Escrito por el modelo de indexación a partir del texto del issue.
Evaluación
- Stack tecnológico
- typescript
- Área
- compilers
- Tipo de issue
- Error
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Estado de actividad
- Estancado
- Claridad
- Bastante claro
- Aptitud para principiantes
- 42/100