require-blank-line-between-import-groups
WarningSeparate import groups with one blank line and keep the imports of a group together.
import { zod } from 'zod'import { delta } from './delta'import { zod } from "zod"; // pinnedimport { delta } from "./delta";import { alpha } from "bun";import { beta } from "bunyan";import { zod } from "zod";import { delta } from "./delta";import "./polyfill";import type { Alpha } from "~/alpha";import type { Alpha } from "~/alpha";import { delta } from "~/delta";import { readFile } from "node:fs";import { zod } from "zod";import { alpha, beta,} from "zod";import { root } from ".";import { gamma } from "../gamma";import Icon from "virtual:icons/alpha";import { zod } from "zod";import { delta } from "./delta";import { zod } from "zod";import { react } from "react";import { gamma } from "../gamma";import { delta } from "./delta";import type { Alpha } from "alpha";import type { Beta } from "beta";import "./polyfill";import "./reset";import "./polyfill";import "./reset";import type { Alpha } from "~/alpha";import type { Beta } from "beta";import { readFile } from "node:fs";import { serve } from "bun";import { zod } from "zod";import legacy = require("legacy");import { root } from ".";import { gamma } from "../gamma";import { delta } from "./delta";import { epsilon } from "~/epsilon";import Icon from "virtual:icons/alpha";import "virtual:uno.css";export const value = 1;import { alpha, beta,} from "zod";import { gamma } from "react";import { delta, epsilon,} from "~/delta";import type { Alpha } from "alpha";import type { Beta } from "~/beta";import { gamma } from "react";import { zod } from "zod";// Needed for its side effects.import "./polyfill";import { zod } from "zod"; // pinnedimport { delta } from "./delta";import { zod } from "zod";const value = 1;import { zod } from 'zod'import { delta } from './delta'import { zod } from "zod";export { zod } from "zod";import { delta } from "./delta";import { zod } from "zod";// Local modules.import { delta } from "./delta";import { zod } from "zod";const lazy = import("./lazy");How to fix
Leave one blank line between import groups and none inside a group. The groups and their order are the ones in require-import-group-order, with internal and relative imports sharing one group.
The check reads the file's text because the syntax tree omits blank lines. It reports the first import of a group that lacks the blank line before it, or the second import of a group that has a blank line before it. When a block has several mistakes, the report can land on a neighboring import.