Support for Ordered Groups Without Redundant Configuration #350
Unanswered
BijanProgrammer
asked this question in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Description:
Currently, to enforce a specific order for import groups (e.g.,
@/assets
before@/components
), we must explicitly list each group inimportOrder
, leading to redundant configuration. I’d like to request a feature that allows specifying the order without listing each group separately.Current Behavior:
To achieve the following order with separators:
react
importsnext/*
imports@/assets
@/components
@/dto
@/icons
@/utils
I have to configure it like this:
However, the group definitions (
@/assets
,@/components
, etc.) are redundant.Requested Feature:
It would be great to add a flag or configuration option that automatically groups imports based on their parent directory structure. For example, imports from
@/assets
would automatically be grouped separately from those in@/components
without needing to explicitly list each folder inimportOrder
. This flag would ensure that imports from different parent folders are placed in different groups with separators, without the need to manually define every group.Example:
With the
autoGroupByParentDirectory
flag enabled, imports from different directories under@/
(like@/assets
,@/components
,@/utils
, etc.) would automatically be separated into distinct groups with appropriate newlines between them.Why This Matters:
.prettierrc
Would love to hear thoughts on whether this could be supported or if there's an alternative approach I might have missed. Thanks for the great work on this plugin! 🚀
Beta Was this translation helpful? Give feedback.
All reactions