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: fixes complex decorators not being handled #461

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

hugop95
Copy link
Contributor

@hugop95 hugop95 commented Feb 5, 2025

Fixes #460

Description

Complex decorators such as @A.B(() => C) are currently not handled. This PR fixes this.

Proposed solution

We used to get the decorator name by switch-casing on the type of decorator. It turns out to be simpler to use sourceCode.getText(decorator), remove the first character @, and split at the first ( instead.

Affected rules

  • sort-classes
  • sort-modules
  • sort-decorators

What is the purpose of this pull request?

  • Bug fix

@hugop95 hugop95 marked this pull request as ready for review February 5, 2025 08:32
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: Unexpected decorator expression's callee type
1 participant