Registry / testing / eslint-plugin-istanbul

eslint-plugin-istanbul

JSON →
library0.1.2jsnpmunverified

ESLint plugin providing rules to enforce best practices for istanbul code coverage comments. Current stable version 0.1.2, low release cadence (last release 2020). Key differentiators: specifically targets istanbul ignore comments (no-ignore-file, prefer-ignore-reason) to maintain code quality in coverage exclusions. Requires ESLint 6.x or 7.x (not compatible with ESLint 8+/9+). Lightweight, no runtime dependencies beyond ESLint peer dependency.

npm install eslint-plugin-istanbul
INSTALL
IMPORT
SIG · ESLINT-PLUGIN-ISTA
E
eslint-plugin-istanbul
testingjavascriptv0.1.2
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
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 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

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

plugin
plugins: ['istanbul']
plugins: ['eslint-plugin-istanbul']
In ESLint config, omit the 'eslint-plugin-' prefix; use just 'istanbul'.
rules
"istanbul/no-ignore-file": "error"
"no-ignore-file": "error"
All rules must be prefixed with 'istanbul/'.
FlatConfig (ESLint 9+)
import eslintPluginIstanbul from 'eslint-plugin-istanbul'; export default [{ plugins: { istanbul: eslintPluginIstanbul }, rules: { 'istanbul/no-ignore-file': 'error' } }]
using 'extends' or 'plugins' array in flat config
ESLint 9+ flat config requires importing the plugin object and assigning to a plugins object with key 'istanbul'.

Shows ESLint configuration with both plugin rules and usage of istanbul ignore comments.

// Install: npm install --save-dev eslint eslint-plugin-istanbul // .eslintrc.json { "plugins": ["istanbul"], "rules": { "istanbul/no-ignore-file": "error", "istanbul/prefer-ignore-reason": "error" } } // In your code: /* istanbul ignore next -- needs refactor */ function deprecatedFunction() { return 42; } /* istanbul ignore file */ // This will cause an error with no-ignore-file rule
Debug
Known issues
breakingRequires ESLint 6.x or 7.x; incompatible with ESLint 8+ and 9+ flat config without migration
fix
Use eslint-plugin-istanbul only with ESLint 6 or 7, or migrate to ESLint 8+ using flat config and check plugin compatibility (may need alternative plugins).
affects: >=0.0.0
deprecatedThe 'prefer-ignore-reason' rule may become stricter in future versions
fix
Always provide a reason in ignore comments: /* istanbul ignore next -- reason */
affects: >=0.1.0
gotchaPlugin rules only catch certain ignore comment formats; malformed comments may pass
fix
Ensure ignore comments follow exactly: /* istanbul ignore <type> -- optional reason */ or // istanbul ignore <type>
affects: >=0.0.0
Errors
Common errors & fixes
Error: Failed to load plugin 'istanbul': Cannot find module 'eslint-plugin-istanbul'
Plugin not installed or ESLint cannot resolve it.
fix
Run npm install --save-dev eslint-plugin-istanbul and ensure node_modules is in the right location.
Error: Configuration for rule 'istanbul/no-ignore-file' is invalid: Value "error" must be an object or a string/array
ESLint expects rule severity to be a number (0,1,2) or string ('off','warn','error').
fix
Use "error" (string) is correct; ensure your config file is valid JSON.
ReferenceError: eslint is not defined (when using flat config)
Trying to use old-style .eslintrc in ESLint 9+ without proper FlatConfig setup.
fix
Migrate to flat config: export default [{ plugins: { istanbul: require('eslint-plugin-istanbul') }, rules: { 'istanbul/no-ignore-file': 'error' } }]
Upgrade
Version history
0.1.2latest on npm
Audit
Dependencies
eslintrequiredPeer dependency; plugin requires ESLint 6.x or 7.x to function
Agent activity
4 hits · last 30 days
node
4
Resources
eslint-plugin-istanbul — npm install eslint-plugin-istanbul · libregistry