antfu / antfu/eslint-plugin-command

`keep-sorted` for subset of object keys

Open
#23 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
TypeScript
Stars
371
Forks
18
PR merge metrics
No merged PRs in 30d

Description

Clear and concise description of the problem

For example, suppose you have:

const object = {
  // Group of entries
  b: true,
  c: true,
  a: true,

  // Other group of entries
  z: true,
  x: true,
  y: true,
}

It would be nice if I could add keep-sorted above a group of entries to sort them separately. Right now adding the comment above one of the groups results in:

[keep-sorted] error: Unable to find object/array/interface to sort  command/command
Suggested solution

Allow keep-sorted above a group of entries

Alternative

No response

Additional context

No response

Validations

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the keep-sorted handling in the repository and reproduce the reported error using the object example and the command/command path. Done means a keep-sorted comment can apply to one group of object keys independently while other groups remain separate, without the unable-to-find error.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
tooling
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.