-
-
Notifications
You must be signed in to change notification settings - Fork 722
Open
Description
Part of #13610, tracking issue for sorting ImportDeclaration.
Phase 0: Foundation parts
- Research prior arts
- Use
@perfectionist/sort-importsas a reference - https://perfectionist.dev/rules/sort-imports
- Use
- Decide how to integrate it to current formatter workflow
- Reorder IR, after formatting
- Implement very basic sorting
- Setup tests and verify current architecture
Phase 1: Features behind default options
- Fix
options.typedefault alphabetical, not properly implementedlocaleCompare -
options.partitionByComments(boolean only) -
options.partitionByNewline -
options.sortSideEffects -
options.order -
options.ignoreCase -
options.newlinesBetween -
options.groups - Clean up comments, credits, and past trials
- Investigate perf improvement with this benchmark result
- Align default
groupswithprettier-plugin-sort-importsdefault?
Phase 2: More advanced options, features
- Perf: Skip sorting if
ImportDeclarationnot found - Handle ignore comments
-
options.customGroups - Consider to support or not
options.internalPatternoptions.fallbackSortoptions.environmentoptions.specialCharactersoptions.type: natural, unsortedoptions.localesoptions.partitionByComments(non-boolean)- Support
ImportEquals,require()?
haltcasebc-m, fengmk2, kasmacioma and ghiscoding
Metadata
Metadata
Assignees
Labels
A-formatterArea - FormatterArea - Formatter