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

fix(sort-interfaces): prevents constructor declarations from being sorted #415

Merged
merged 2 commits into from
Dec 12, 2024

Conversation

hugop95
Copy link
Contributor

@hugop95 hugop95 commented Dec 12, 2024

Fixes #414

Description

Similarly to call signatures, this PR prevents constructor signatures from being sorted together.

interface Interface {
  new (value: number | string): number;
  new (value: number): unknown;
}

Changes

  • Fixes the bug
  • Adds tests for both sort-interfaces and sort-object-types.
  • Renames a few tests.

What is the purpose of this pull request?

  • Bug fix

* Reported by ESLint.
* Condition now useless as we now filter on the last possible type: `TSConstructSignatureDeclaration`
@hugop95 hugop95 force-pushed the fix/sort-interfaces/constructor branch from c94b8e0 to e1b5e4d Compare December 12, 2024 20:41
@hugop95 hugop95 marked this pull request as ready for review December 12, 2024 20:44
@azat-io
Copy link
Owner

azat-io commented Dec 12, 2024

Looks good.

Is it a critical bug?

@hugop95
Copy link
Contributor Author

hugop95 commented Dec 12, 2024

@azat-io

Is it a critical bug?

  • It can only break compilation and not runtime.
  • It's been here for a long time but wasn't reported until recently.
  • It can be temporarily fixed with // eslint-disable.

=> Not critical in my opinion.

@azat-io
Copy link
Owner

azat-io commented Dec 12, 2024

Thanks!

@azat-io azat-io merged commit b4ee1cc into azat-io:main Dec 12, 2024
8 checks passed
@hugop95 hugop95 deleted the fix/sort-interfaces/constructor branch December 12, 2024 23:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bug: sort-interfaces changes overload ordering for constructors
2 participants