📄 isTypeImport.ts¶
📊 Analysis Summary¶
| Metric | Count |
|---|---|
| 🔧 Functions | 1 |
| 📦 Imports | 4 |
📚 Table of Contents¶
🛠️ File Location:¶
📂 packages/eslint-plugin/src/util/isTypeImport.ts
📦 Imports¶
| Name | Source |
|---|---|
Definition |
@typescript-eslint/scope-manager |
ImportBindingDefinition |
@typescript-eslint/scope-manager |
DefinitionType |
@typescript-eslint/scope-manager |
AST_NODE_TYPES |
@typescript-eslint/utils |
Functions¶
isTypeImport(definition: Definition): definition is ImportBindingDefinition¶
Code
export function isTypeImport(
definition?: Definition,
): definition is ImportBindingDefinition {
return (
definition?.type === DefinitionType.ImportBinding &&
(definition.parent.importKind === 'type' ||
(definition.node.type === AST_NODE_TYPES.ImportSpecifier &&
definition.node.importKind === 'type'))
);
}
-
JSDoc:
-
Parameters:
definition: Definition- Return Type:
definition is ImportBindingDefinition