Fix comments inside JSX attributes (#14082)
Fixes https://github.com/prettier/prettier/issues/11242
This commit is contained in:
1 parent
ef707da0a2
commit
e301b1f9ce
5 files changed
+111
-2
No files matched your search
@@ -0,0 +1,17 @@
|
||||
#### Fix formatting for comments inside JSX attribute (#14082 with by @fisker)
|
||||
|
||||
<!-- prettier-ignore -->
|
||||
```jsx
|
||||
// Input
|
||||
function MyFunctionComponent() {
|
||||
<button label=/*old*/"new">button</button>
|
||||
}
|
||||
|
||||
// Prettier stable
|
||||
Error: Comment "old" was not printed. Please report this error!
|
||||
|
||||
// Prettier main
|
||||
function MyFunctionComponent() {
|
||||
<button label=/*old*/ "new">button</button>;
|
||||
}
|
||||
```
|
||||
Reference in new issue
Block a user