eslint-plugin-json-es provides a robust JSON parser for ESLint, enabling developers to lint JSON files using many standard ESLint rules. The current stable version is `1.6.0`, with a release cadence that includes regular dependency updates and feature additions. A key differentiator of this plugin is its use of ESLint's internal `espree` parser, which allows it to leverage a significant number of existing ESLint rules directly on JSON content. This contrasts with alternatives like `eslint-plugin-json` that rely on VSCode's JSON validation and offer less extensibility, or `eslint-plugin-jsonc` which uses custom AST node types. It supports autofixing and custom rules, making it a versatile choice for integrating JSON linting into an existing ESLint workflow.
npm install eslint-plugin-json-esVerified import paths — ran on the pinned version, not inferred.
Configures ESLint in a `.eslintrc.json` file to use `eslint-plugin-json-es` as the parser for all `.json` files, applying its recommended rules and an additional custom rule.
Upgrade your Node.js environment to version 18.x, 20.x, or 22.x for guaranteed compatibility and support.
Ensure your project's `eslint` peer dependency is `^7.0.0` or newer. Update ESLint to a compatible version if necessary.
Review the plugin's documentation and 'recommended' configuration. Enable only those ESLint rules that are suitable for JSON syntax, or create custom rule sets specific to your JSON linting needs.
Refine the `files` array in your `.eslintrc.json` overrides block to specifically target JSON files, e.g., `"files": ["*.json"]` or `"files": ["**/*.json"]`.
Ensure the plugin is installed as a development dependency: `npm install eslint-plugin-json-es --save-dev`. Verify that your `.eslintrc.json` correctly references the plugin, especially in the `parser` and `extends` fields.
Double-check the rule name against the plugin's documentation. Ensure that any custom rules from this plugin are correctly prefixed with `json-es/` (e.g., `json-es/use-camel-case`).