Currently, there's no way to configure sort-named-imports and sort-named-exports to group inline type import/exports.
Code example
When using this rule to sort named imports alphabetically, we get:
import { A, type B, C, type D} from 'rurouni-kenshin'
This is fine, but IMO we should have an option to group inline type imports before/after value imports to improve readability.
Same goes for named exports.
Additional comments
I've implemented this by adding an option called group-kind with possible values mixed (default, current behavior), values-first, and types-first.
// group-kind: mixed
import { A, type B, C, type D} from 'rurouni-kenshin'
// group-kind: values-first
import { A, C, type B, type D } from 'rurouni-kenshin'
// group-kind: types-first
import { type B, type D, A, C } from 'rurouni-kenshin'
What rule do you want to change?
sort-named-imports
&sort-named-exports
Describe the problem
Hey, first of all, love this plugin!
Currently, there's no way to configure
sort-named-imports
andsort-named-exports
to group inline type import/exports.Code example
When using this rule to sort named imports alphabetically, we get:
This is fine, but IMO we should have an option to group inline
type
imports before/aftervalue
imports to improve readability.Same goes for named exports.
Additional comments
I've implemented this by adding an option called
group-kind
with possible valuesmixed
(default, current behavior),values-first
, andtypes-first
.Not sure how https://github.com/azat-io/eslint-plugin-perfectionist/pull/113 will affect it, but I've opened https://github.com/azat-io/eslint-plugin-perfectionist/pull/115 anyway. If we agree that this should be doable on this plugin, I can reimplement it on v3.
Validations