ESLint plugin for linting JSON files. Version 4.0.1 supports ESLint flat config and requires Node >=18. It uses VSCode's JSON parser for linting, replacing JSHint in v1.3.1. Recommended for ensuring valid JSON, catching duplicate keys, trailing commas, and other issues. Supports allowing comments. The plugin ships with recommended configs for both flat and legacy ESLint formats.
npm install eslint-plugin-jsonVerified import paths — ran on the pinned version, not inferred.
Basic flat config setup to lint all .json files using the recommended config.
Use eslint-plugin-json v4+ and flat config format (eslint.config.js).
Define files glob in eslint.config.js instead of --ext .json.
Use individual rules like 'json/undefined' for granular control, or set severity on json/*.
Migrate to flat config and use recommended config.
Switch to eslint.config.js (flat config).
npm install --save-dev eslint-plugin-json
Add processor: 'json/json' in flat config or use recommended config.
This is not a json plugin issue; configure linebreak-style rule elsewhere.