testCasePaddingLines
Enforces padding around
testblocks.
✅ This rule is included in the vitest stylisticStrict presets.
Blank lines around test() and it() blocks make individual cases read like separate units.
That spacing is especially helpful in suites with many neighboring cases, focused tests, or skipped tests.
Examples
Section titled “Examples”import { it, test } from "vitest";
const first = "bar";const second = "baz";it(first, () => { // ...});it.only(second, () => { // ...});test("third", () => { // ...});test("fourth", () => { // ...});import { describe, expect, it, test } from "vitest";
describe("nested", () => { const thing = 123; test("one", () => { expect(thing).toBe(123); }); // With a comment it("two", () => { expect(thing).toBe(123); }); test.skip("three", () => { // ... }); it.skip("four", () => { // ... });});import { it, test } from "vitest";
const first = "bar";const second = "baz";
it(first, () => { // ...});
it.only(second, () => { // ...});
test("third", () => { // ...});
test("fourth", () => { // ...});import { describe, expect, it, test } from "vitest";
describe("nested", () => { const thing = 123;
test("one", () => { expect(thing).toBe(123); });
// With a comment it("two", () => { expect(thing).toBe(123); });
test.skip("three", () => { // ... });
it.skip("four", () => { // ... });});Options
Section titled “Options”This rule is not configurable.
When Not To Use It
Section titled “When Not To Use It”If your project keeps very small test files and prefers denser case lists, the extra blank lines from this rule may not be worth it. That can be reasonable when each suite contains only a handful of short tests.
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.