Check AST shape instead of parser (#18672)

This commit is contained in:
fisker Cheung authored and GitHub committed 2026-01-18 02:51:15 +08:00
1 parent 0bc2286c9d
commit 68b64f2aa3
1 file changed
+1 -3
+1 -3
View File
@@ -146,9 +146,7 @@ function chooseLayout(path, options, print, leftDoc, rightPropertyName) {
(rightNode.type === "CallExpression" &&
rightNode.callee.name === "require") ||
// do not put values on a separate line from the key in json
options.parser === "json5" ||
options.parser === "jsonc" ||
options.parser === "json"
path.root.type === "JsonRoot"
) {
return "never-break-after-operator";
}