remove_import_name
Remove a single name from a multi-name Python or JS/TS import statement. Use when dropping one imported name without deleting the whole import line.
Instructions
Remove one name from a from <module> import ... (Python) or import { ... } from "<module>" (JS/TS) statement. A name on a line of its own
goes with that line and its comment. Removing the only name removes the
statement, but is refused when a default import would be left with
empty braces (import D, { a } from "m"): use remove_import, then
add_import.
Use this when: dropping one name from a multi-name import. Don't use this when: removing the whole import line (remove_import).
Example: module="typing" name="List"
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | One imported name, e.g. 'Optional'. | |
| module | Yes | Module of the import as written, without quotes (e.g. 'typing' or './utils'). | |
| file_path | Yes | Absolute path to the source or config file. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |