{"id":19942,"library":"eslint-plugin-sort-keys-fix","title":"eslint-plugin-sort-keys-fix","description":"ESLint plugin that extends the built-in sort-keys rule with automatic fix capability. Version 1.1.2 is the latest stable release. This plugin sorts object keys alphabetically and provides autofix on save, unlike the core rule which only reports errors. It supports all native sort-keys options except minKeys and works with ESLint's --fix flag. Maintained as a fork with occasional updates, it's a convenient tool for enforcing consistent key ordering without manual effort.","status":"active","version":"1.1.2","language":"javascript","source_language":"en","source_url":"https://github.com/leo-buneev/eslint-plugin-sort-keys-fix","tags":["javascript","eslint","eslintplugin","eslint-plugin"],"install":[{"cmd":"npm install eslint-plugin-sort-keys-fix","lang":"bash","label":"npm"},{"cmd":"yarn add eslint-plugin-sort-keys-fix","lang":"bash","label":"yarn"},{"cmd":"pnpm add eslint-plugin-sort-keys-fix","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Peer dependency required as an ESLint plugin.","package":"eslint","optional":false}],"imports":[{"note":"Requires both plugin declaration and rule entry.","wrong":"rules: { 'sort-keys-fix': 'warn' } without plugins section","symbol":"Plugin (eslint-plugin-sort-keys-fix)","correct":"plugins: ['sort-keys-fix']"},{"note":"Rule name includes the plugin prefix 'sort-keys-fix/'.","wrong":"\"sort-keys-fix\": \"warn\"","symbol":"Rule (sort-keys-fix/sort-keys-fix)","correct":"\"sort-keys-fix/sort-keys-fix\": \"warn\""},{"note":"Options match ESLint sort-keys: [severity, order, optionsObject].","wrong":"","symbol":"Sort options","correct":"{ \"sort-keys-fix/sort-keys-fix\": [\"warn\", \"asc\", { \"caseSensitive\": false }] }"}],"quickstart":{"code":"// .eslintrc.json\n{\n  \"plugins\": [\"sort-keys-fix\"],\n  \"rules\": {\n    \"sort-keys-fix/sort-keys-fix\": [\"warn\", \"asc\", { \"caseSensitive\": true, \"natural\": false }]\n  }\n}\n\n// file.js – will be fixed on save/--fix\nconst obj = {\n  z: 1,\n  a: 2\n}; // fixed to { a: 2, z: 1 }","lang":"json","description":"Enable the sort-keys-fix rule with autofix in ESLint config. Object keys will be sorted alphabetically."},"warnings":[{"fix":"Use ESLint's --fix flag or editor integration to trigger autofix.","message":"The rule only sorts top-level keys, not nested objects by default.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Do not use minKeys option; it will be ignored or cause errors.","message":"minKeys option from ESLint sort-keys is not supported.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Update to 1.1.2 or review sorting behavior for objects with spread operators.","message":"Version 1.1.0 changed how spread operators are handled: property groups split by spread are now sorted separately.","severity":"breaking","affected_versions":">=1.1.0 <1.1.2"}],"env_vars":null,"last_verified":"2026-04-25T00:00:00.000Z","next_check":"2026-07-24T00:00:00.000Z","problems":[{"fix":"npm install eslint-plugin-sort-keys-fix --save-dev","cause":"Plugin package not installed or not in node_modules.","error":"ESLint couldn't find the plugin \"sort-keys-fix\""},{"fix":"Use severity string directly: \"sort-keys-fix/sort-keys-fix\": \"warn\"","cause":"Rule configuration used without options specified incorrectly.","error":"Configuration for rule \"sort-keys-fix/sort-keys-fix\" is invalid: Value \"warn\" is the wrong type. Expected array or string."},{"fix":"Add 'plugins: [\"sort-keys-fix\"]' in ESLint config.","cause":"Plugin not declared in plugins array, or rule name misspelled.","error":"Definition for rule 'sort-keys-fix/sort-keys-fix' was not found."}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}