{"id":25514,"library":"eslint-plugin-json-format","title":"eslint-plugin-json-format","description":"An ESLint plugin to lint, format, auto-fix, and sort JSON files. Version 2.0.1 is the latest stable release (last updated September 2019). It extends ESLint's capabilities to handle .json and rc files (like .eslintrc, .babelrc) with auto-fix support. Key differentiators include built-in package.json sorting (standard/pro/custom order), ignoring JSON-with-comments files like tsconfig.json, and ignoring package-lock.json by default. Requires ESLint >= 3.2.1. The plugin is in maintenance mode with no recent updates.","status":"maintenance","version":"2.0.1","language":"javascript","source_language":"en","source_url":"https://github.com/bkucera/eslint-plugin-json-format","tags":["javascript","eslint","eslint-plugin","eslint-plugin-json","eslintplugin","json","json-format"],"install":[{"cmd":"npm install eslint-plugin-json-format","lang":"bash","label":"npm"},{"cmd":"yarn add eslint-plugin-json-format","lang":"bash","label":"yarn"},{"cmd":"pnpm add eslint-plugin-json-format","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Peer dependency; required to load and use the plugin.","package":"eslint","optional":false}],"imports":[{"note":"ESLint automatically prefixes 'eslint-plugin-', so use 'json-format' in plugins array.","wrong":"plugins: ['eslint-plugin-json-format']","symbol":"plugin","correct":"plugins: ['json-format']"},{"note":"The setting key must be quoted because it contains a slash. Also, 'sort-package-json' was renamed from 'package-json-sort-order' in v2.0.0.","wrong":"settings: { json/sort-package-json: 'standard' }","symbol":"settings","correct":"settings: { 'json/sort-package-json': 'standard' }"},{"note":"Rule names are prefixed with 'json-format/' (e.g., 'json-format/sort-package-json', 'json-format/json-format').","wrong":"rules: { 'json/*': 'error' }","symbol":"rules","correct":"rules: { 'json-format/*': 'error' }"}],"quickstart":{"code":"npm install eslint --save-dev\nnpm install eslint-plugin-json-format --save-dev\n\necho '{\"plugins\":[\"json-format\"],\"settings\":{\"json/sort-package-json\":\"standard\",\"json/ignore-files\":[\"**/package-lock.json\"],\"json/json-with-comments-files\":[\"**/tsconfig.json\",\".vscode/**\"]}}' > .eslintrc.json\n\necho '{\"name\":\"test\",\"version\":\"1.0.0\",\"scripts\":{\"test\":\"echo \\\"Error: no test specified\\\" && exit 1\"},\"license\":\"ISC\"}' > package.json\n\neslint --ext .js,.json,.eslintrc,.babelrc --fix .","lang":"bash","description":"Install ESLint and the plugin, create a minimal .eslintrc.json configuration, and run ESLint with --fix on JSON files to auto-format and sort."},"warnings":[{"fix":"Use 'json/sort-package-json' instead of 'json/package-json-sort-order'.","message":"In v2.0.0, the setting 'package-json-sort-order' was renamed to 'sort-package-json'.","severity":"breaking","affected_versions":"<2.0.0"},{"fix":"Update your configuration to match the new schema (e.g., 'json/sort-package-json': 'standard').","message":"The 'sort-package-json' setting now expects a string ('standard', 'pro', false) or an array. Previously it accepted a different format.","severity":"breaking","affected_versions":"<2.0.0"},{"fix":"Do not include files that require comments (e.g., .vscode/settings.json) in 'json-with-comments-files', or disable auto-fix for those files.","message":"The plugin will strip comments from files listed in 'json-with-comments-files' (like tsconfig.json) if linted with --fix.","severity":"gotcha","affected_versions":"all"},{"fix":"Add '!.*' to .eslintignore or use 'eslint --ext .js,.json input/.eslintrc.json'.","message":"To lint hidden files (e.g., .eslintrc.json), you must explicitly include them using a .eslintignore or the --ext flag with explicit names.","severity":"gotcha","affected_versions":"all"},{"fix":"Consider alternatives like eslint-plugin-json or eslin-plugin-jsonc for newer ESLint versions.","message":"The plugin is no longer actively maintained; last release was in 2019.","severity":"deprecated","affected_versions":">=2.0.1"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Update ESLint to version >=3.2.1: npm install eslint@latest --save-dev","cause":"ESLint version mismatch: plugin requires ESLint >= 3.2.1, but used with an older version.","error":"Cannot read property 'getFilename' of undefined"},{"fix":"Use 'json-format/sort-package-json' or 'json-format/*' wildcard, not 'json-format/json-format'. Example: 'rules': { 'json-format/*': 'error' }","cause":"Trying to configure a rule that does not exist or using incorrect rule name prefix.","error":"Configuration for rule \"json-format/json-format\" is invalid"},{"fix":"Run 'npm install eslint-plugin-json-format --save-dev' and ensure your ESLint config file is in the project root.","cause":"Plugin not installed or not listed in package.json dependencies.","error":"ESLint couldn't find the plugin \"eslint-plugin-json-format\""},{"fix":"Add the file pattern to 'json/json-with-comments-files' setting or remove comments from the file.","cause":"Plugin tried to parse a JSON file with comments (JSONC) without explicit configuration.","error":"Unexpected token / in JSON at position 0"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}