{"id":13601435,"url":"https://github.com/mthadley/eslint-plugin-sort-destructure-keys","last_synced_at":"2025-04-05T05:09:30.661Z","repository":{"id":39520714,"uuid":"132411345","full_name":"mthadley/eslint-plugin-sort-destructure-keys","owner":"mthadley","description":"ESLint plugin to check if keys should be sorted in an object pattern.","archived":false,"fork":false,"pushed_at":"2024-07-22T13:50:42.000Z","size":1042,"stargazers_count":96,"open_issues_count":12,"forks_count":9,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-29T04:11:15.849Z","etag":null,"topics":["destructuring","eslint","eslint-plugin","lint","sort"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/eslint-plugin-sort-destructure-keys","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"isc","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mthadley.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-05-07T05:28:44.000Z","updated_at":"2025-02-11T20:23:33.000Z","dependencies_parsed_at":"2024-06-18T13:36:13.668Z","dependency_job_id":"0f766852-c485-40b2-b942-6fdda4f9da37","html_url":"https://github.com/mthadley/eslint-plugin-sort-destructure-keys","commit_stats":{"total_commits":282,"total_committers":11,"mean_commits":"25.636363636363637","dds":0.4893617021276596,"last_synced_commit":"8d0160838fabfb1dfc1b4592310d7bd1c3e14fd9"},"previous_names":[],"tags_count":16,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mthadley%2Feslint-plugin-sort-destructure-keys","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mthadley%2Feslint-plugin-sort-destructure-keys/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mthadley%2Feslint-plugin-sort-destructure-keys/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mthadley%2Feslint-plugin-sort-destructure-keys/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mthadley","download_url":"https://codeload.github.com/mthadley/eslint-plugin-sort-destructure-keys/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247289429,"owners_count":20914464,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["destructuring","eslint","eslint-plugin","lint","sort"],"created_at":"2024-08-01T18:01:02.713Z","updated_at":"2025-04-05T05:09:30.633Z","avatar_url":"https://github.com/mthadley.png","language":"JavaScript","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"readme":"# eslint-plugin-sort-destructure-keys\n\nrequire object destructure key to be sorted\n\n## Installation\n\nYou'll first need to install [ESLint](http://eslint.org):\n\n```\n$ npm i eslint --save-dev\n```\n\nNext, install `eslint-plugin-sort-destructure-keys`:\n\n```\n$ npm install eslint-plugin-sort-destructure-keys --save-dev\n```\n\n**Note:** If you installed ESLint globally (using the `-g` flag) then you must also install `eslint-plugin-sort-destructure-keys` globally.\n\n## Usage\n\nAdd `sort-destructure-keys` to the plugins section of your `.eslintrc` configuration file. You can omit the `eslint-plugin-` prefix:\n\n```json\n{\n  \"plugins\": [\"sort-destructure-keys\"]\n}\n```\n\nThen configure the rule under the rules section.\n\n```json\n{\n  \"rules\": {\n    \"sort-destructure-keys/sort-destructure-keys\": 2\n  }\n}\n```\n\n## Rule Options\n\n```json\n{\n  \"sort-destructure-keys/sort-destructure-keys\": [2, { \"caseSensitive\": false }]\n}\n```\n\n### `caseSensitive`\n\nWhen `true` the rule will enforce properties to be in case-sensitive order. Default is `true`.\n\nExample of **incorrect** code for the `{\"caseSensitive\": false}` option:\n\n```js\nlet { B, a, c } = obj;\n```\n\nExample of **correct** code for the `{\"caseSensitive\": false}` option:\n\n```js\nlet { a, B, c } = obj;\n```\n\nExample of **incorrect** code for the `{\"caseSensitive\": true}` option:\n\n```js\nlet { a, B, c } = obj;\n```\n\nExample of **correct** code for the `{\"caseSensitive\": true}` option:\n\n```js\nlet { B, a, c } = obj;\n```\n\n## Changelog\n\n### `2.0.0`\n\n- Drop support for ESLint versions older than 5. ([#269])\n\n[#269]: https://github.com/mthadley/eslint-plugin-sort-destructure-keys/pull/269\n\n### `1.6.0`\n\n- Add compatibility for ESLint 9. ([#267], by [ptb])\n\n[#267]: https://github.com/mthadley/eslint-plugin-sort-destructure-keys/pull/267\n[ptb]: https://github.com/ptb\n\n### `1.5.0`\n\n- Allow sorting properties with defaults when the default doesn't reference\n  other properties ([#215], by [ianobermiller]).\n\n[#215]: https://github.com/mthadley/eslint-plugin-sort-destructure-keys/pull/215\n[ianobermiller]: https://github.com/ianobermiller\n\n### `1.4.0`\n\n- Add compatibility with eslint 8. ([#123])\n\n[#123]: https://github.com/mthadley/eslint-plugin-sort-destructure-keys/pull/123\n\n### `1.3.5`\n\n- Add `^7.0.0` to eslint peer dependency. ([#53], by [dsernst])\n\n[#53]: https://github.com/mthadley/eslint-plugin-sort-destructure-keys/pull/53\n[dsernst]: https://github.com/dsernst\n\n### `1.3.4`\n\n- Fixes TypeError issue with multiple property expressions. ([#20])\n\n[#20]: https://github.com/mthadley/eslint-plugin-sort-destructure-keys/issues/20\n\n### `1.3.3`\n\n- Add `6.0.0` to eslint peer dependency. ([#21], by [@7rulnik])\n\n[#21]: https://github.com/mthadley/eslint-plugin-sort-destructure-keys/pull/21\n[@7rulnik]: https://github.com/7rulnik\n\n### `1.3.2`\n\n- Fix bug where computed properties were causing the rule to throw errors. ([#15], thanks [@TSMMark]!)\n\n[#15]: https://github.com/mthadley/eslint-plugin-sort-destructure-keys/issues/15\n[@tsmmark]: https://github.com/TSMMark\n\n### `1.3.1`\n\n- Fix bug with rest properties being sorted incorrectly. ([#11], [#12], thanks [@briandastous] and [@njdancer]!)\n\n[#11]: https://github.com/mthadley/eslint-plugin-sort-destructure-keys/issues/11\n[@briandastous]: https://github.com/briandastous\n[#12]: https://github.com/mthadley/eslint-plugin-sort-destructure-keys/pull/12\n[@njdancer]: https://github.com/njdancer\n\n### `1.3.0`\n\n- Add support for `--fix` eslint cli flag\n\n### `1.2.0`\n\n- Add peer dependency support for eslint `^5.0.0`\n\n### `1.1.0`\n\n- Add `caseSensitive` option ([#1] by [@bsonntag])\n\n[#1]: https://github.com/mthadley/eslint-plugin-sort-destructure-keys/pull/1\n[@bsonntag]: https://github.com/bsonntag\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmthadley%2Feslint-plugin-sort-destructure-keys","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmthadley%2Feslint-plugin-sort-destructure-keys","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmthadley%2Feslint-plugin-sort-destructure-keys/lists"}