diff --git a/tests/format/js/comments/in-list/14723.js b/tests/format/js/comments/in-list/14723.js new file mode 100644 index 000000000..9c4dbea68 --- /dev/null +++ b/tests/format/js/comments/in-list/14723.js @@ -0,0 +1,10 @@ +function doSomething(first, second) { + combineLatest([ + first.watchIt().pipe( + // tap(x => console.log(x)) + ), + second.watchIt().pipe( + tap((x) => console.log(x)) + ), + ]) +} diff --git a/tests/format/js/comments/in-list/9678.js b/tests/format/js/comments/in-list/9678.js new file mode 100644 index 000000000..6a65f3ed8 --- /dev/null +++ b/tests/format/js/comments/in-list/9678.js @@ -0,0 +1,16 @@ +class C11 { + constructor( + //a + //b + ){} + + method( + //a + //b + ){} + + get getter( + //a + //b + ){} +} diff --git a/tests/format/js/comments/in-list/__snapshots__/format.test.js.snap b/tests/format/js/comments/in-list/__snapshots__/format.test.js.snap index ddad5515d..4d231f67c 100644 --- a/tests/format/js/comments/in-list/__snapshots__/format.test.js.snap +++ b/tests/format/js/comments/in-list/__snapshots__/format.test.js.snap @@ -1,5 +1,77 @@ // Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing +exports[`9678.js format 1`] = ` +====================================options===================================== +parsers: ["babel", "flow", "typescript"] + printWidth: 80 (default) | +=====================================input====================================== +class C11 { + constructor( + //a + //b + ){} + + method( + //a + //b + ){} + + get getter( + //a + //b + ){} +} + +=====================================output===================================== +class C11 { + constructor( + //a + //b + ) {} + + method( + //a + //b + ) {} + + get getter( + //a + //b + ) {} +} + +================================================================================ +`; + +exports[`14723.js format 1`] = ` +====================================options===================================== +parsers: ["babel", "flow", "typescript"] + printWidth: 80 (default) | +=====================================input====================================== +function doSomething(first, second) { + combineLatest([ + first.watchIt().pipe( + // tap(x => console.log(x)) + ), + second.watchIt().pipe( + tap((x) => console.log(x)) + ), + ]) +} + +=====================================output===================================== +function doSomething(first, second) { + combineLatest([ + first.watchIt().pipe( + // tap(x => console.log(x)) + ), + second.watchIt().pipe(tap((x) => console.log(x))), + ]); +} + +================================================================================ +`; + exports[`dangling-comment-in-list.js format 1`] = ` ====================================options===================================== parsers: ["babel", "flow", "typescript"]