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

ClassDeclaration type is missing decorators #938

Open
gaggarwal-patreon opened this issue May 10, 2023 · 1 comment
Open

ClassDeclaration type is missing decorators #938

gaggarwal-patreon opened this issue May 10, 2023 · 1 comment

Comments

@gaggarwal-patreon
Copy link

You can find the definition of ClassDeclaration here. Note that there doesn't exist a field for decorators even though it exists for several other nodes such as ClassAccessorProperty and ClassMethod.

However, it is possible to have a class decorator such as the following:

@sealed
class BugReport {
  type = "report";
  title: string;
 
  constructor(t: string) {
    this.title = t;
  }
}

In this case, the decorators field does exist on ClassDeclaration. Can we update the types to reflect this?

@gaggarwal-patreon gaggarwal-patreon changed the title ClassDeclaration is missing decorators ClassDeclaration type is missing decorators May 10, 2023
@ElonVolo
Copy link

PR #660 has had this ready to go for two years. This really needs to be merged, as there's no shortage of angular code that makes use of class decorators.

I'll add that right now ChatGPT is generating jscodeshift codemods that rely on this functionality being present.

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

No branches or pull requests

2 participants