eslint-plugin-sonarjs
Version:
11 lines (10 loc) • 704 B
TypeScript
import type { TSESTree } from '@typescript-eslint/utils';
export declare function getJsxShortCircuitNodes(logicalExpression: TSESTree.LogicalExpression): TSESTree.LogicalExpression[] | null;
/**
* Checks whether a JSX element has a matching descendant in a rendered child position.
*
* This follows JSX children, expressions, conditionals, arrays, TypeScript wrappers, and
* map/flatMap callbacks. It deliberately excludes JSX attributes, non-rendering callbacks,
* and bare function children.
*/
export declare function someRenderedJsxDescendant(element: TSESTree.JSXElement, predicate: (element: TSESTree.JSXElement) => boolean, shouldPrune?: (element: TSESTree.JSXElement) => boolean): boolean;