@returns {boolean}
(path)
| 179 | @returns {boolean} |
| 180 | */ |
| 181 | function shouldPrintClassInGroupModeWithoutCache(path) { |
| 182 | const { node } = path; |
| 183 | if ( |
| 184 | hasComment(node.id, CommentCheckFlags.Trailing) || |
| 185 | hasComment(node.typeParameters, CommentCheckFlags.Trailing) || |
| 186 | hasComment(node.superClass) || |
| 187 | hasMultipleHeritage(node) |
| 188 | ) { |
| 189 | return true; |
| 190 | } |
| 191 | |
| 192 | if (node.superClass) { |
| 193 | if (path.parent.type === "AssignmentExpression") { |
| 194 | return false; |
| 195 | } |
| 196 | |
| 197 | return ( |
| 198 | !node.superTypeArguments && |
| 199 | isMemberExpression(stripChainElementWrappers(node.superClass)) |
| 200 | ); |
| 201 | } |
| 202 | |
| 203 | const heritage = |
| 204 | node.extends?.[0] ?? node.mixins?.[0] ?? node.implements?.[0]; |
| 205 | |
| 206 | if (!heritage) { |
| 207 | return false; |
| 208 | } |
| 209 | |
| 210 | const groupMode = |
| 211 | // `ClassImplements` seem not allow `QualifiedTypeIdentifier` |
| 212 | (heritage.type === "InterfaceExtends" && |
| 213 | heritage.id.type === "QualifiedTypeIdentifier" && |
| 214 | !heritage.typeParameters) || |
| 215 | ((heritage.type === "TSClassImplements" || |
| 216 | heritage.type === "TSInterfaceHeritage") && |
| 217 | isMemberExpression(heritage.expression) && |
| 218 | !heritage.typeArguments); |
| 219 | |
| 220 | return groupMode; |
| 221 | } |
| 222 | |
| 223 | const shouldPrintClassInGroupModeCache = new WeakMap(); |
| 224 | function shouldPrintClassInGroupMode(path) { |
no test coverage detected
searching dependent graphs…