allPaddingLines
Enforces padding around Vitest blocks.
✅ This rule is included in the vitest stylisticStrict presets.
Blank lines between Vitest hooks, suites, test cases, and assertion groups make test files easier to scan. This rule applies the same spacing convention across those block types so a file reads with a more consistent rhythm.
Examples
Section titled “Examples”import { beforeEach, expect, it } from "vitest";
const value = "cherry";beforeEach(() => { // ...});it("does something", () => { const count = 1; expect(count).toBe(1); console.log(value);});import { afterAll, describe, expect, test } from "vitest";
const server = { close() {}, running: true,};
describe("server", () => { afterAll(() => { server.close(); }); test("responds", () => { expect(server.running).toBe(true); });});import { beforeEach, expect, it } from "vitest";
const value = "cherry";
beforeEach(() => { // ...});
it("does something", () => { const count = 1;
expect(count).toBe(1);
console.log(value);});import { afterAll, describe, expect, test } from "vitest";
const server = { close() {}, running: true,};
describe("server", () => { afterAll(() => { server.close(); });
test("responds", () => { expect(server.running).toBe(true); });});Options
Section titled “Options”This rule is not configurable.
When Not To Use It
Section titled “When Not To Use It”If you want spacing rules for only one part of Vitest syntax, the narrower padding rules may fit your project better. This rule can feel too opinionated for compact test files because it applies one spacing style across multiple kinds of statements.
Further Reading
Section titled “Further Reading”Equivalents in Other Linters
Section titled “Equivalents in Other Linters”- ESLint:
vitest/padding-around-all
Made with ❤️🔥 around the world by
the Flint team and contributors.