(
sourceCode: Readonly<TSESLint.SourceCode>,
node: TSESTree.Node,
)
| 158 | ) |
| 159 | }, |
| 160 | getFunctionAncestor( |
| 161 | sourceCode: Readonly<TSESLint.SourceCode>, |
| 162 | node: TSESTree.Node, |
| 163 | ) { |
| 164 | for (const ancestor of sourceCode.getAncestors(node)) { |
| 165 | if ( |
| 166 | ASTUtils.isNodeOfOneOf(ancestor, [ |
| 167 | AST_NODE_TYPES.FunctionDeclaration, |
| 168 | AST_NODE_TYPES.FunctionExpression, |
| 169 | AST_NODE_TYPES.ArrowFunctionExpression, |
| 170 | ]) |
| 171 | ) { |
| 172 | return ancestor |
| 173 | } |
| 174 | |
| 175 | if ( |
| 176 | ancestor.parent?.type === AST_NODE_TYPES.VariableDeclarator && |
| 177 | ancestor.parent.id.type === AST_NODE_TYPES.Identifier && |
| 178 | ASTUtils.isNodeOfOneOf(ancestor, [ |
| 179 | AST_NODE_TYPES.FunctionDeclaration, |
| 180 | AST_NODE_TYPES.FunctionExpression, |
| 181 | AST_NODE_TYPES.ArrowFunctionExpression, |
| 182 | ]) |
| 183 | ) { |
| 184 | return ancestor |
| 185 | } |
| 186 | } |
| 187 | |
| 188 | return undefined |
| 189 | }, |
| 190 | getReferencedExpressionByIdentifier(params: { |
| 191 | node: TSESTree.Node |
| 192 | context: Readonly<TSESLint.RuleContext<string, ReadonlyArray<unknown>>> |
nothing calls this directly
no outgoing calls
no test coverage detected