Registry / testing / eslint-plugin-no-snapshot-testing

eslint-plugin-no-snapshot-testing

JSON →
library1.0.61jsnpmunverified

An ESLint plugin (v1.0.61) that enforces a rule disallowing snapshot testing in Jest. It prevents calls to `toMatchSnapshot` and `toMatchInlineSnapshot`, offering an auto-fix to remove them. This package is a niche utility for teams that ban snapshot testing. It has a simple setup, only one rule, and is dependency-light. No known major alternative exists with identical focus.

npm install eslint-plugin-no-snapshot-testing
INSTALL
IMPORT
SIG · ESLINT-PLUGIN-NO-S
E
eslint-plugin-no-snapshot-testing
testingjavascriptv1.0.61
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 (default)
✓ plugins: ['no-snapshot-testing']
✗ plugins: ['eslint-plugin-no-snapshot-testing']
ESLint expects short plugin name; the 'eslint-plugin-' prefix is omitted.
rule (no-snapshot-testing/no-snapshot-testing)
✓ rules: { 'no-snapshot-testing/no-snapshot-testing': 'error' }
✗ rules: { 'no-snapshot-testing/no-snapshot': 'error' }
The rule name is 'no-snapshot-testing', not a shorter variant.
rule options
✓ rules: { 'no-snapshot-testing/no-snapshot-testing': ['error', { ... }] }
✗ rules: { 'no-snapshot-testing/no-snapshot-testing': ['error', { ... }] }
No official options documented; plugin is simple.

Shows ESLint config enabling the plugin and rule, and an example of a flagged snapshot call.

// .eslintrc.js module.exports = { plugins: ['no-snapshot-testing'], rules: { 'no-snapshot-testing/no-snapshot-testing': 'error', }, }; // test.js const x = 1; expect(x).toMatchSnapshot(); // ESLint error + fix removes this line
Debug
Known issues
gotchaThe rule name is repetitive: 'no-snapshot-testing/no-snapshot-testing'.
fix
Use exactly as documented; no alternative rule name exists.
affects: >=1.0.0
gotchaOnly disallows Jest snapshot matchers; not other snapshot-like patterns (e.g., manual file snapshots).
fix
Extend rule or use additional ESLint configurations if needed.
affects: >=1.0.0
gotchaAuto-fix removes the entire `expect(...).toMatchSnapshot()` line; may remove other chained matchers if on same line.
fix
Ensure snapshot call is on its own line before auto-fix.
affects: >=1.0.0
gotchaNo support for custom matchers that wrap snapshot testing.
fix
Plugin is intentionally limited; consider custom ESLint rules for advanced cases.
affects: >=1.0.0
Errors
Common errors & fixes
ESLint couldn't find the plugin "eslint-plugin-no-snapshot-testing".
Plugin not installed or ESLint cannot resolve it.
fix
Run `npm install eslint-plugin-no-snapshot-testing --save-dev` and check node_modules.
Rule "no-snapshot-testing/no-snapshot-testing" is not defined.
Plugin not listed in 'plugins' array or misspelled.
fix
Add 'no-snapshot-testing' to plugins in .eslintrc.
Cannot read property 'rule' of undefined
Invalid plugin configuration: using 'rules' with wrong format.
fix
Ensure plugins array contains 'no-snapshot-testing' and rules object key is 'no-snapshot-testing/no-snapshot-testing'.
Upgrade
Version history
1.0.61latest on npm
Audit
Dependencies
eslintrequiredpeer dependency: required for plugin to function
Agent activity
4 hits · last 30 days
node
4
Resources
eslint-plugin-no-snapshot-testing — npm install eslint-plugin-no-snapshot-testing · libregistry