{"id":13143,"library":"eslint-plugin-json-es","title":"ESLint Plugin for JSON Files","description":"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.","status":"active","version":"1.6.0","language":"javascript","source_language":"en","source_url":"https://github.com/zeitport/eslint-plugin-json-es","tags":["javascript","eslint","eslint-parser","eslint-plugin","JSON","parser"],"install":[{"cmd":"npm install eslint-plugin-json-es","lang":"bash","label":"npm"},{"cmd":"yarn add eslint-plugin-json-es","lang":"bash","label":"yarn"},{"cmd":"pnpm add eslint-plugin-json-es","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Required peer dependency for ESLint functionality and version compatibility.","package":"eslint","optional":false}],"imports":[{"note":"Configures ESLint to use this plugin as the parser for specific files (e.g., *.json). Always use the full package name.","wrong":"    \"parser\": \"json-es\"","symbol":"parser","correct":"    \"parser\": \"eslint-plugin-json-es\""},{"note":"Applies the recommended set of rules provided by the plugin. The 'plugin:' prefix is crucial.","wrong":"    \"extends\": \"eslint-plugin-json-es/recommended\"","symbol":"extends","correct":"    \"extends\": \"plugin:eslint-plugin-json-es/recommended\""},{"note":"When enabling specific rules provided by this plugin, they must be prefixed with `json-es/`.","wrong":"        \"use-camel-case\": \"error\"","symbol":"rule definition","correct":"        \"json-es/use-camel-case\": \"error\""}],"quickstart":{"code":"{\n    \"overrides\": [{\n        \"files\": [\"*.json\"],\n        \"parser\": \"eslint-plugin-json-es\",\n        \"extends\": \"plugin:eslint-plugin-json-es/recommended\",\n        \"rules\": {\n            \"json-es/use-camel-case\": \"error\",\n            \"indent\": [\"error\", 2]\n        }\n    }]\n}","lang":"javascript","description":"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."},"warnings":[{"fix":"Upgrade your Node.js environment to version 18.x, 20.x, or 22.x for guaranteed compatibility and support.","message":"Node.js 16.x is no longer officially supported as of version 1.6.0. It may or may not work.","severity":"breaking","affected_versions":">=1.6.0"},{"fix":"Ensure your project's `eslint` peer dependency is `^7.0.0` or newer. Update ESLint to a compatible version if necessary.","message":"This plugin requires ESLint version 7 or higher. Older ESLint versions are not supported.","severity":"breaking","affected_versions":"<1.0.0"},{"fix":"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.","message":"While the plugin allows many existing ESLint rules to work with JSON, not all JavaScript-centric rules make logical sense or function correctly for JSON files. Applying inappropriate rules can lead to unexpected errors or irrelevant linting suggestions.","severity":"gotcha","affected_versions":"*"}],"env_vars":null,"last_verified":"2026-04-19T00:00:00.000Z","next_check":"2026-07-18T00:00:00.000Z","problems":[{"fix":"Refine the `files` array in your `.eslintrc.json` overrides block to specifically target JSON files, e.g., `\"files\": [\"*.json\"]` or `\"files\": [\"**/*.json\"]`.","cause":"The `files` array in the ESLint `overrides` configuration is too broad, causing the JSON parser to be applied to non-JSON files.","error":"Parsing error: ESLint was configured to run on JSON files but encountered a JavaScript file instead."},{"fix":"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.","cause":"The plugin package is either not installed, or ESLint cannot resolve its path.","error":"ESLint couldn't find the plugin \"eslint-plugin-json-es\"."},{"fix":"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`).","cause":"The specified rule name is incorrect, misspelled, or the rule does not exist within the `eslint-plugin-json-es` package.","error":"Configuration for rule 'json-es/non-existent-rule' is invalid:..."}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":""}