-
Notifications
You must be signed in to change notification settings - Fork 25
Feature Proposal: Grouped Import Sorting in Typstyle (Similar to Python’s isort) #212
Copy link
Copy link
Open
Description
generated by genai from unstructured chat logs
Issue Description
Currently, Typstyle does not have any functionality for sorting imports. This can lead to inconsistent and disorganized import statements in code, reducing readability and maintainability. This proposal suggests adding import sorting to Typstyle, similar to tools like Python’s isort, to automatically organize imports in a consistent and logical manner.
Proposed Feature
Implement an import sorting feature that:
- Sorts Imports Alphabetically: Orders
importstatements alphabetically. - Groups Imports (Optional): Allows imports to be grouped logically (e.g., standard library, third-party, local modules) with empty lines separating groups.
Implementation Considerations
- Basic Sorting:
- Sort all imports alphabetically by default.
- Handle both
importandfrom ... importstatements.
- Grouping (Optional):
- Detect and group imports by type (e.g., standard library, third-party, local modules).
- Separate groups with empty lines.
cc @QuadnucYard
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels