📄 isStartOfExpressionStatement¶
📊 Analysis Summary¶
| Metric | Count |
|---|---|
| 🔧 Functions | 1 |
| 📦 Imports | 2 |
📚 Table of Contents¶
🛠️ File Location:¶
📂 packages/eslint-plugin/src/util/isStartOfExpressionStatement.ts
📦 Imports¶
| Name | Source |
|---|---|
TSESTree |
@typescript-eslint/utils |
AST_NODE_TYPES |
@typescript-eslint/utils |
Functions¶
isStartOfExpressionStatement(node: TSESTree.Node): boolean¶
Tests if a node appears at the beginning of an ancestor ExpressionStatement node.
Parameters:
nodeany: The node to check.
Returns: undefined
Whether the node appears at the beginning of an ancestor ExpressionStatement node.
Raw JSDoc
Code
export function isStartOfExpressionStatement(node: TSESTree.Node): boolean {
const start = node.range[0];
let ancestor: TSESTree.Node | undefined = node;
while ((ancestor = ancestor.parent) && ancestor.range[0] === start) {
if (ancestor.type === AST_NODE_TYPES.ExpressionStatement) {
return true;
}
}
return false;
}
Generated by Syntax Scribe