MCPcopy
hub / github.com/tailwindlabs/prettier-plugin-tailwindcss / isSortableExpression

Function isSortableExpression

src/index.ts:539–557  ·  view source on GitHub ↗
(
  node: import('@babel/types').Expression | import('@babel/types').V8IntrinsicIdentifier,
  matcher: Matcher,
)

Source from the content-addressed store, hash-verified

537}
538
539function isSortableExpression(
540 node: import('@babel/types').Expression | import('@babel/types').V8IntrinsicIdentifier,
541 matcher: Matcher,
542): boolean {
543 // Traverse property accesses and function calls to find the leading ident
544 while (node.type === 'CallExpression' || node.type === 'MemberExpression') {
545 if (node.type === 'CallExpression') {
546 node = node.callee
547 } else if (node.type === 'MemberExpression') {
548 node = node.object
549 }
550 }
551
552 if (node.type === 'Identifier') {
553 return matcher.hasFunction(node.name)
554 }
555
556 return false
557}
558
559function canCollapseWhitespaceIn(
560 path: Path<import('@babel/types').Node, any>,

Callers 2

isSortableCallExpressionFunction · 0.85

Calls 1

hasFunctionMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…