📄 isTypeImport¶
📊 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¶
Determine whether a variable definition is a type import. e.g.:
Parameters:
definitionany: The variable definition to check.
Raw JSDoc
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'))
);
}
Generated by Syntax Scribe