Skip to content

describePaddingLines

Enforces padding around describe blocks.

✅ This rule is included in the vitest stylisticStrict presets.

Blank lines around describe() blocks make suite boundaries easier to recognize. That helps nested suites read like separate sections instead of blending into surrounding setup and declarations.

import { describe } from "vitest";
const suiteName = "text";
// A comment before describe
describe(suiteName, () => {
describe("trimmed", () => {
// ...
});
describe("raw", () => {
// ...
});
});
describe.skip("skipped", () => {
// ...
});
import { describe } from "vitest";
describe.only("focused", () => {
// ...
});
describe.skip("later", () => {
// ...
});
const skippedName = "another";
describe.skip(skippedName, () => {
// ...
});

This rule is not configurable.

If your team intentionally treats small describe() blocks like inline grouping rather than visual sections, the added blank lines may feel too spread out. That can be reasonable in short files with only one or two tiny suites.

Made with ❤️‍🔥 around the world by the Flint team and contributors.