Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Try another solution
  • Loading branch information
fisker committed Dec 28, 2022
commit 07d8883b87837eeceb55c10ae8b550a1bfec680d
14 changes: 7 additions & 7 deletions src/language-js/print/type-parameters.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,17 +39,17 @@ function printTypeParameters(path, options, print, paramsKey) {
!(node[paramsKey].length === 1 && isObjectType(node[paramsKey][0])),
undefined,
(node, name) => name === "typeAnnotation",
(node) => node.type === "Identifier",
(node, name) => node.type === "Identifier" && name === "id",
isArrowFunctionVariableDeclarator
);

const shouldInline =
node[paramsKey].length === 0 ||
(!isArrowFunctionVariable &&
(isParameterInTestCall ||
(node[paramsKey].length === 1 &&
(node[paramsKey][0].type === "NullableTypeAnnotation" ||
shouldHugType(node[paramsKey][0])))));
!isArrowFunctionVariable &&
(isParameterInTestCall ||
node[paramsKey].length === 0 ||
(node[paramsKey].length === 1 &&
(node[paramsKey][0].type === "NullableTypeAnnotation" ||
shouldHugType(node[paramsKey][0]))));

if (shouldInline) {
return [
Expand Down