securityos/node_modules/eslint-plugin-sonarjs/lib/utils/conditions.d.ts

14 lines
658 B
TypeScript
Raw Normal View History

2024-09-06 15:32:35 +00:00
import type { TSESTree } from '@typescript-eslint/experimental-utils';
/** Returns a list of statements corresponding to a `if - else if - else` chain */
export declare function collectIfBranches(node: TSESTree.IfStatement): {
branches: TSESTree.Statement[];
endsWithElse: boolean;
};
/** Returns a list of `switch` clauses (both `case` and `default`) */
export declare function collectSwitchBranches(node: TSESTree.SwitchStatement): {
branches: TSESTree.Statement[][];
endsWithDefault: boolean;
};
/** Excludes the break statement from the list */
export declare function takeWithoutBreak(nodes: TSESTree.Statement[]): TSESTree.Statement[];