-
Notifications
You must be signed in to change notification settings - Fork 54
Open
Labels
enhancementNew feature or requestNew feature or request
Description
What rule do you want to change?
sort-imports
Describe the problem
With alphabetic imports sorting, I would like to be able to enforce strict order between type- and value- imports from the same module.
Code example
For example, with this setup:
"perfectionist/sort-imports": ["error", {
groups: [
["builtin", "builtin-type"],
["external", "external-type"],
["internal", "internal-type"],
["parent", "parent-type"],
["sibling", "sibling-type", "index", "index-type"],
"unknown",
],
newlinesBetween: "always",
order: "asc",
type: "alphabetical",
}],this is valid code:
import { antfu } from "@antfu/eslint-config"
import type { Awaitable } from "@antfu/eslint-config"
import annotation from "eslint-plugin-annotation"and this is too:
import type { Awaitable } from "@antfu/eslint-config"
import { antfu } from "@antfu/eslint-config"
import annotation from "eslint-plugin-annotation"I would like to be able to enforce either of the above (configurable — either put type imports first, or second, or do not sort — by default, as it works now).
Additional comments
No response
Validations
- Read the docs.
- Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request