---
url: 'https://adk.nht.io/api/eslint/functions/collectImportBindings.md'
---

# Function: collectImportBindings()

```ts
function collectImportBindings(ast: Program): ImportBindings;
```

Defined in: [src/eslint/rules/common.ts:105](https://github.com/NHTIO/ADK/blob/v1.20261103.0/src/src/eslint/rules/common.ts#L105)

Collects the file's import bindings, so [resolveCalleeName](resolveCalleeName.md) can map a local callee name to
the export it denotes.

## Parameters

| Parameter | Type      |
| --------- | --------- |
| `ast`     | `Program` |

## Returns

[`ImportBindings`](../type-aliases/ImportBindings.md)

## Remarks

Call once at the top of a rule's `Program()` visitor and keep the result in the rule's closure —
ESLint walks the AST depth-first, so a call can lexically precede its own import statement. A
later import of the same local name overwrites the earlier one; imports in one scope cannot
legally collide, so this only ever resolves a genuine redeclaration.
