For AI agents: the complete documentation index is available at https://rslint.rs/llms.txt, the full documentation bundle is available at https://rslint.rs/llms-full.txt, and this page is available as Markdown at https://rslint.rs/rules/jest/padding-around-all.md.
close

padding-around-all

Added in v0.9.2

Configuration

PresetConfigured Value
✅ jestPlugin.configs.all"error"
rslint.config.ts
import { defineConfig, jestPlugin } from '@rslint/core';

export default defineConfig([
  jestPlugin.configs.recommended,
  {
    rules: {
      'jest/padding-around-all': 'error',
    },
  },
]);

Rule Details

Require blank lines around Jest lifecycle hooks, suites, tests, and assertion groups. This rule combines all seven padding-around-* rules in one configuration entry. Consecutive expect statements form one group and do not require blank lines between them.

Incorrect

const database = createDatabase();
beforeAll(() => database.connect());
test('loads a user', () => {
  const user = loadUser();
  expect(user.name).toBe('Ada');
});

Correct

const database = createDatabase();

beforeAll(() => database.connect());

test('loads a user', () => {
  const user = loadUser();

  expect(user.name).toBe('Ada');
});

Autofix

The rule inserts missing blank lines around matching statements and assertion groups.

Original Documentation