Registry / testing / eslint-plugin-jest-formatting

eslint-plugin-jest-formatting

JSON →
library3.1.0jsnpmunverified

ESLint plugin providing formatting rules for Jest test suites, version 3.1.0 (supports ESLint 8.x). It enforces consistent padding (blank lines) around test blocks like describe, test, after-all, etc. Most rules are auto-fixable. Differentiators: focused solely on formatting (not linting logic), with recommended and strict config presets. Release cadence is sporadic; last major was v3.0.0 with breaking changes. Active maintenance status.

npm install eslint-plugin-jest-formatting
INSTALL
IMPORT
SIG · ESLINT-PLUGIN-JEST
E
eslint-plugin-jest-formatting
testingjavascriptv3.1.0
Install
—
Import
—
Disk
—
Pass rate
0/ 6
Env Coverage0 / 6
glibc
18–22
musl
18–22
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18–226 runs
build_error
glibc
node 18–226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

plugin
✓ plugins: ['jest-formatting']
✗ plugins: ['eslint-plugin-jest-formatting']
ESLint automatically strips the eslint-plugin- prefix for plugin references.
recommended config
✓ extends: ['plugin:jest-formatting/recommended']
✗ extends: ['jest-formatting/recommended']
Must include the plugin: prefix when referencing configs.
strict config
✓ extends: ['plugin:jest-formatting/strict']
✗ extends: ['jest-formatting']
Strict config enables all rules; plain 'jest-formatting' is invalid.

Configures ESLint to enforce padding around describe and test blocks in Jest files.

// .eslintrc.json { "plugins": ["jest-formatting"], "rules": { "jest-formatting/padding-around-describe-blocks": 2, "jest-formatting/padding-around-test-blocks": 2 } } // test file example describe('suite', () => { beforeEach(() => { jest.clearAllMocks(); }); it('test', () => { expect(true).toBe(true); }); });
Debug
Known issues
breakingBreaking change in v3.0.0: Padding is no longer enforced between statements and awaited statements of the same kind.
fix
Review tests that relied on padding between consecutive awaits or sync statements; adjust expectations accordingly.
affects: 3.0.0 - 3.1.0
breakingBreaking change in v3.0.0: Removed deprecated rules (padding-before-*).
fix
Migrate to the new padding-around-* rules (e.g., padding-around-test-blocks instead of padding-before-test-blocks).
affects: >=3.0.0
breakingBreaking change in v2.0.0: Minimum Node version raised to ^10.12.0 || >=12.0.0.
fix
Update Node to a supported version (10.12+ or 12+).
affects: >=2.0.0
deprecatedOld rule names like 'padding-before-test-blocks' are deprecated in v1.1.1+.
fix
Use new rule names: 'padding-around-test-blocks' etc.
affects: >=1.1.1
Errors
Common errors & fixes
Definition for rule 'jest-formatting/padding-around-describe-blocks' was not found.
Plugin not installed or not in ESLint plugins config.
fix
Run 'npm install eslint-plugin-jest-formatting --save-dev' and add 'jest-formatting' to plugins in .eslintrc.
ESLint couldn't find the config "plugin:jest-formatting/recommended".
Missing 'plugin:' prefix in extends.
fix
Use 'extends: ["plugin:jest-formatting/recommended"]' instead of 'extends: ["jest-formatting/recommended"]'.
Upgrade
Version history
3.1.0latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
6 hits · last 30 days
node
6
Resources
eslint-plugin-jest-formatting — npm install eslint-plugin-jest-formatting · libregistry