{"id":19797,"library":"eslint-plugin-istanbul","title":"eslint-plugin-istanbul","description":"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.","status":"maintenance","version":"0.1.2","language":"javascript","source_language":"en","source_url":"https://github.com/istanbuljs/eslint-plugin-istanbul","tags":["javascript","eslint","istanbul","coverage"],"install":[{"cmd":"npm install eslint-plugin-istanbul","lang":"bash","label":"npm"},{"cmd":"yarn add eslint-plugin-istanbul","lang":"bash","label":"yarn"},{"cmd":"pnpm add eslint-plugin-istanbul","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Peer dependency; plugin requires ESLint 6.x or 7.x to function","package":"eslint","optional":false}],"imports":[{"note":"In ESLint config, omit the 'eslint-plugin-' prefix; use just 'istanbul'.","wrong":"plugins: ['eslint-plugin-istanbul']","symbol":"plugin","correct":"plugins: ['istanbul']"},{"note":"All rules must be prefixed with 'istanbul/'.","wrong":"\"no-ignore-file\": \"error\"","symbol":"rules","correct":"\"istanbul/no-ignore-file\": \"error\""},{"note":"ESLint 9+ flat config requires importing the plugin object and assigning to a plugins object with key 'istanbul'.","wrong":"using 'extends' or 'plugins' array in flat config","symbol":"FlatConfig (ESLint 9+)","correct":"import eslintPluginIstanbul from 'eslint-plugin-istanbul';\nexport default [{ plugins: { istanbul: eslintPluginIstanbul }, rules: { 'istanbul/no-ignore-file': 'error' } }]"}],"quickstart":{"code":"// Install: npm install --save-dev eslint eslint-plugin-istanbul\n// .eslintrc.json\n{\n  \"plugins\": [\"istanbul\"],\n  \"rules\": {\n    \"istanbul/no-ignore-file\": \"error\",\n    \"istanbul/prefer-ignore-reason\": \"error\"\n  }\n}\n\n// In your code:\n/* istanbul ignore next -- needs refactor */\nfunction deprecatedFunction() { return 42; }\n\n/* istanbul ignore file */ // This will cause an error with no-ignore-file rule","lang":"javascript","description":"Shows ESLint configuration with both plugin rules and usage of istanbul ignore comments."},"warnings":[{"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).","message":"Requires ESLint 6.x or 7.x; incompatible with ESLint 8+ and 9+ flat config without migration","severity":"breaking","affected_versions":">=0.0.0"},{"fix":"Always provide a reason in ignore comments: /* istanbul ignore next -- reason */","message":"The 'prefer-ignore-reason' rule may become stricter in future versions","severity":"deprecated","affected_versions":">=0.1.0"},{"fix":"Ensure ignore comments follow exactly: /* istanbul ignore <type> -- optional reason */ or // istanbul ignore <type>","message":"Plugin rules only catch certain ignore comment formats; malformed comments may pass","severity":"gotcha","affected_versions":">=0.0.0"}],"env_vars":null,"last_verified":"2026-04-25T00:00:00.000Z","next_check":"2026-07-24T00:00:00.000Z","problems":[{"fix":"Run npm install --save-dev eslint-plugin-istanbul and ensure node_modules is in the right location.","cause":"Plugin not installed or ESLint cannot resolve it.","error":"Error: Failed to load plugin 'istanbul': Cannot find module 'eslint-plugin-istanbul'"},{"fix":"Use \"error\" (string) is correct; ensure your config file is valid JSON.","cause":"ESLint expects rule severity to be a number (0,1,2) or string ('off','warn','error').","error":"Error: Configuration for rule 'istanbul/no-ignore-file' is invalid: Value \"error\" must be an object or a string/array"},{"fix":"Migrate to flat config: export default [{ plugins: { istanbul: require('eslint-plugin-istanbul') }, rules: { 'istanbul/no-ignore-file': 'error' } }]","cause":"Trying to use old-style .eslintrc in ESLint 9+ without proper FlatConfig setup.","error":"ReferenceError: eslint is not defined (when using flat config)"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}