Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sort keys by type #68

Open
2 tasks done
Grawl opened this issue Sep 7, 2023 · 1 comment
Open
2 tasks done

Sort keys by type #68

Grawl opened this issue Sep 7, 2023 · 1 comment
Labels
enhancement New feature or request

Comments

@Grawl
Copy link

Grawl commented Sep 7, 2023

Describe the problem

I want to sort object properties by its type

Code example

I have the following type object:

type MyObject = {
  updatedAt: Date
  count: number
  createdAt: Date
}

I want to colocate properties by type, so Date will be next to each other:

type MyObject = {
  count: number
  createdAt: Date
  updatedAt: Date
}

Additional comments

No response

Validations

  • Read the docs.
  • Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
@Grawl Grawl added the enhancement New feature or request label Sep 7, 2023
@azat-io azat-io mentioned this issue Nov 24, 2023
4 tasks
@hugop95
Copy link
Contributor

hugop95 commented Sep 12, 2024

Commenting because I like the idea, but some subjects need to be addressed, such as:

  • How to deal with union/intersection types?
  • What takes precedence between alphabetical sorting and type name sorting?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants