`keep-sorted` for subset of object keys

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

Nobody has claimed this yet.

Assessment

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

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.

Description

enhancement
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
Dominant language
TypeScript
Stars
372
Forks
18
PR merge metrics
No merged PRs in 30d

Getting set up

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.

More from antfu/eslint-plugin-command

All issues in antfu/eslint-plugin-command

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.