From cb00f45d71e2cc28fe6313fdcd921c901c2277c8 Mon Sep 17 00:00:00 2001 From: fisker Cheung Date: Sun, 12 Jul 2026 12:15:43 +0800 Subject: [PATCH] Add an example for how to force comment-only array or object to keep multiple line in blog post (#19605) Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com> --- website/blog/2026-06-27-3.9.0.md | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/website/blog/2026-06-27-3.9.0.md b/website/blog/2026-06-27-3.9.0.md index 6fc88261e..048dad117 100644 --- a/website/blog/2026-06-27-3.9.0.md +++ b/website/blog/2026-06-27-3.9.0.md @@ -557,6 +557,28 @@ const array = [/* comment */]; const object = {/* comment */}; ``` +_You can use line comment or multiline comment to force the array and object to break._ + + +```js +const array = [ + // comment +]; +const object = { + // comment +}; +const array2 = [ + /* + comment + */ +]; +const object2 = { + /* + comment + */ +}; +``` + #### Fix dangling comment print in function parameters ([#18623](https://github.com/prettier/prettier/pull/18623) by [@fisker](https://github.com/fisker)) {#change-18623}