conditions.d.ts 658 B

12345678910111213
  1. import type { TSESTree } from '@typescript-eslint/experimental-utils';
  2. /** Returns a list of statements corresponding to a `if - else if - else` chain */
  3. export declare function collectIfBranches(node: TSESTree.IfStatement): {
  4. branches: TSESTree.Statement[];
  5. endsWithElse: boolean;
  6. };
  7. /** Returns a list of `switch` clauses (both `case` and `default`) */
  8. export declare function collectSwitchBranches(node: TSESTree.SwitchStatement): {
  9. branches: TSESTree.Statement[][];
  10. endsWithDefault: boolean;
  11. };
  12. /** Excludes the break statement from the list */
  13. export declare function takeWithoutBreak(nodes: TSESTree.Statement[]): TSESTree.Statement[];