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-istanbulVerified import paths — ran on the pinned version, not inferred.
Shows ESLint configuration with both plugin rules and usage of istanbul ignore comments.
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).
Always provide a reason in ignore comments: /* istanbul ignore next -- reason */
Ensure ignore comments follow exactly: /* istanbul ignore <type> -- optional reason */ or // istanbul ignore <type>
Run npm install --save-dev eslint-plugin-istanbul and ensure node_modules is in the right location.
Use "error" (string) is correct; ensure your config file is valid JSON.
Migrate to flat config: export default [{ plugins: { istanbul: require('eslint-plugin-istanbul') }, rules: { 'istanbul/no-ignore-file': 'error' } }]