diff --git a/tests/format/typescript/comments/11639.ts b/tests/format/typescript/comments/11639.ts new file mode 100644 index 000000000..b36a59ba7 --- /dev/null +++ b/tests/format/typescript/comments/11639.ts @@ -0,0 +1,14 @@ +const foo = forwardRef(({ + // foo + size, + // onClose, + // onOpen, + }: PopoverProps, +) => {}) + +export function Component({ + prop, + // comment +}: Type) { + return div; +} diff --git a/tests/format/typescript/comments/__snapshots__/format.test.js.snap b/tests/format/typescript/comments/__snapshots__/format.test.js.snap index 9f38d3caa..d0651115e 100644 --- a/tests/format/typescript/comments/__snapshots__/format.test.js.snap +++ b/tests/format/typescript/comments/__snapshots__/format.test.js.snap @@ -69,6 +69,46 @@ type D2 = ================================================================================ `; +exports[`11639.ts format 1`] = ` +====================================options===================================== +parsers: ["typescript"] + printWidth: 80 (default) | +=====================================input====================================== +const foo = forwardRef(({ + // foo + size, + // onClose, + // onOpen, + }: PopoverProps, +) => {}) + +export function Component({ + prop, + // comment +}: Type) { + return div; +} + +=====================================output===================================== +const foo = forwardRef( + ({ + // foo + size, + // onClose, + // onOpen, + }: PopoverProps) => {}, +); + +export function Component({ + prop, + // comment +}: Type) { + return div; +} + +================================================================================ +`; + exports[`11662.ts format 1`] = ` ====================================options===================================== parsers: ["typescript"]