diff --git a/tests/format/typescript/comments/16207.ts b/tests/format/typescript/comments/16207.ts new file mode 100644 index 000000000..6f9cf060a --- /dev/null +++ b/tests/format/typescript/comments/16207.ts @@ -0,0 +1,7 @@ +class Foo { + constructor( + @required + // comment + protected readonly myParam: string, + ) {} +} diff --git a/tests/format/typescript/comments/__snapshots__/format.test.js.snap b/tests/format/typescript/comments/__snapshots__/format.test.js.snap index 032a0e5d5..21c8d1680 100644 --- a/tests/format/typescript/comments/__snapshots__/format.test.js.snap +++ b/tests/format/typescript/comments/__snapshots__/format.test.js.snap @@ -222,6 +222,32 @@ class Foo { ================================================================================ `; +exports[`16207.ts format 1`] = ` +====================================options===================================== +parsers: ["typescript"] +printWidth: 80 + | printWidth +=====================================input====================================== +class Foo { + constructor( + @required + // comment + protected readonly myParam: string, + ) {} +} + +=====================================output===================================== +class Foo { + constructor( + @required + // comment + protected readonly myParam: string, + ) {} +} + +================================================================================ +`; + exports[`abstract_class.ts format 1`] = ` ====================================options===================================== parsers: ["typescript"]