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

Feature: sort-intersection-types and anonymous types #128

Open
2 tasks done
Evalon opened this issue Apr 13, 2024 · 0 comments
Open
2 tasks done

Feature: sort-intersection-types and anonymous types #128

Evalon opened this issue Apr 13, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@Evalon
Copy link

Evalon commented Apr 13, 2024

What rule do you want to change?

sort-intersection-types

Describe the problem

Consider this type:
{ apiKey: string | null } & Config
I think it's better for readability if named (aliased) types (Config) are followed by anonymous types ({ apiKey: string | null }). Also, it feels more explicit in intention.

Code example

constructor(props: { apiKey: string | null } & Config) {
    super(props)
    this.apiKey = props.apiKey
}
--- VS
constructor(props: Config & { apiKey: string | null }) {
    super(props)
    this.apiKey = props.apiKey
}

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.
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

1 participant