require-sorted-named-imports
HintSort the names in an import list alphabetically by local name, ignoring case. The check compares first letters only.
import { beta, alpha } from "alpha";import { gamma, Alpha } from "alpha";import { Tooltip as Root, Anchor } from "ark";import { beta, type Alpha } from "alpha";import beta, { gamma, alpha } from "alpha";import { gamma, beta, alpha,} from "alpha";import { alpha, beta, gamma } from "alpha";import { Alpha, beta, Gamma } from "alpha";import { TooltipPositioner as Positioner, Tooltip, TooltipTrigger as Trigger } from "ark";import { type Alpha, beta } from "alpha";import { onMount, onCleanup } from "solid";import { alpha } from "alpha";import beta, { alpha, gamma } from "alpha";import { alpha, beta,} from "alpha";How to fix
Sort the names between the braces alphabetically, ignoring case, by the name the file uses: the alias in Tooltip as Root, not the exported name. A type modifier does not change the position.
ast-grep cannot compare two names, so the check only reports a name whose first letter comes before the first letter of the name above it. Two names that share a first letter are never reported; order them by hand.