Skip to contentSlop Block

require-import-group-order

Warning

Order imports by group: side-effect, type, built-in, external, index, then internal and relative, then virtual modules.

import { zod } from "zod"; // pinnedimport type { Alpha } from "~/alpha";Move this import above the imports of the groups that follow it
import Icon from "virtual:icons/alpha";import { delta } from "./delta";Move this import above the imports of the groups that follow itimport { epsilon } from "~/epsilon";
import { zod } from "zod";import type { Alpha } from "~/alpha";Move this import above the imports of the groups that follow it
import { zod } from "zod";import { readFile } from "node:fs";Move this import above the imports of the groups that follow it
import { epsilon } from "~/epsilon";import { zod } from "zod";Move this import above the imports of the groups that follow it
import Icon from "virtual:icons/alpha";import { zod } from "zod";Move this import above the imports of the groups that follow it
import { zod } from "zod";import "./polyfill";Move this import above the imports of the groups that follow it
import { delta } from "./delta";import { root } from "./index";Move this import above the imports of the groups that follow it
import { delta } from "./delta";import { root } from ".";Move this import above the imports of the groups that follow it
import "virtual:uno.css";import { delta } from "./delta";Move this import above the imports of the groups that follow it
// ast-grep-ignore: require-import-group-order-typescript

How to fix

Order imports by group, top to bottom:

1. side-effect imports such as import './polyfill';

2. type imports (import type)

3. built-in modules (node: and bun: prefixes, and bun)

4. external packages

5. index imports (., ./, ./index)

6. internal and relative imports (~/, ./, ../)

7. virtual modules (virtual:)

The check reads the statements one by one and does not sort them alphabetically; keep each group alphabetical by hand or with your formatter.