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: handle export {} #93

Merged
merged 1 commit into from
Jun 13, 2022
Merged

Conversation

SevereCloud
Copy link
Contributor

Code

<script>
  export {}
</script>

AST

// ...
{
  type: "ExportNamedDeclaration";
  start: 10;
  end: 19;
  loc: {
    // ...
  }
  declaration: null;
  specifiers: [];
  source: null;
}
// ...

Parse error

TypeError: null is not an object (evaluating 'f.declaration.declarations')

Why need handle export {}?

Typescript compiled

export type A = string

to

export {};

Copy link
Collaborator

@metonym metonym left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice catch, thanks for submitting a fix.

@metonym metonym merged commit 50885b1 into carbon-design-system:main Jun 13, 2022
@metonym
Copy link
Collaborator

metonym commented Jun 13, 2022

Fixed in v0.17.2.

@SevereCloud SevereCloud deleted the empty-export branch June 13, 2022 15:04
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.

2 participants