describePaddingLines
Enforces padding around
describeblocks.
✅ 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.
Examples
Section titled “Examples”import { describe } from "vitest";
const suiteName = "text";// A comment before describedescribe(suiteName, () => { describe("trimmed", () => { // ... }); describe("raw", () => { // ... });});describe.skip("skipped", () => { // ...});import { describe } from "vitest";
describe.only("focused", () => { // ...});describe.skip("later", () => { // ...});const skippedName = "another";describe.skip(skippedName, () => { // ...});import { describe } from "vitest";
const suiteName = "text";
// A comment before describedescribe(suiteName, () => { describe("trimmed", () => { // ... });
describe("raw", () => { // ... });});
describe.skip("skipped", () => { // ...});import { describe } from "vitest";
describe.only("focused", () => { // ...});
describe.skip("later", () => { // ...});
const skippedName = "another";
describe.skip(skippedName, () => { // ...});Options
Section titled “Options”This rule is not configurable.
When Not To Use It
Section titled “When Not To Use It”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.
Further Reading
Section titled “Further Reading”Equivalents in Other Linters
Section titled “Equivalents in Other Linters”
Made with ❤️🔥 around the world by
the Flint team and contributors.