Skip to content

Commit

Permalink
feat: add partition by comment option in sort-classes
Browse files Browse the repository at this point in the history
  • Loading branch information
azat-io committed Jul 22, 2024
1 parent b399197 commit da01c85
Show file tree
Hide file tree
Showing 3 changed files with 408 additions and 146 deletions.
10 changes: 10 additions & 0 deletions docs/content/rules/sort-classes.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,16 @@ Controls whether sorting should be case-sensitive or not.
- `true` — Ignore case when sorting alphabetically or naturally (e.g., “A” and “a” are the same).
- `false` — Consider case when sorting (e.g., “A” comes before “a”).

### partitionByComment

<sub>(default: `false`)</sub>

Allows you to use comments to separate the class members into logical groups. This can help in organizing and maintaining large enums by creating partitions within the enum based on comments.

- `true` — All comments will be treated as delimiters, creating partitions.
- `false` — Comments will not be used as delimiters.
- string — A pattern using [minimatch](https://github.com/isaacs/minimatch) to specify which comments should act as delimiters.

### groups

<sub>(default: `['property', 'constructor', 'method', 'unknown']`)</sub>
Expand Down
Loading

0 comments on commit da01c85

Please sign in to comment.