You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I think we'd need to add a "group" to the rule for type imports for this to be possible.
However, then how would people be able to not separate them? in other words, if they wanted to enforce that type imports were right before, or after, the value imports from the same module?
I would consider group and importTypeGroups to be different dimensions.
Maybe there should be two stages in the rule:
Group and sort by import type
Group and sort inside import type with the specified group ordering
The proposed Option could be called importTypeGroup and look like the following code.
typeImportTypeGroup=Default|TypeFirst|RegularFirst;typeDefault=[['regular','type']// (default) treat them as the same];typeTypeFirst=['type','regular'];typeRegularFirst=['regular','type'];
The Option behaves almost identical as group.
Also the default preserves the current behaviour and would therefore not bother pure JS users.
Options that are modifying the behaviour of group could be also considered here, like newlines-between.
This is currently my best guess on how to implement an easy and clear API that doesn't have to concern non TS users.
I would like to split the imports into regular imports and type imports and apply the specified ordering on each of them individually.
Example:
How could I achieve that behaviour with the order rule?
Thank you for helping in advance.
The text was updated successfully, but these errors were encountered: