Skip to content

Expected ";" but found "const" - typescript transformer #997

@bartlomiejzuber

Description

@bartlomiejzuber

What version of @astrojs/compiler are you using?

2.8.1

What package manager are you using?

npm

What operating system are you using?

Linux

Describe the Bug

In this code sample, the export statement is hoisted, but as const is not.

---
export const allAboutUsPreviewCards = [
] as const;
---

as const is correctly hoisted if the const declaration is only takes up one line.

Link to Minimal Reproducible Example

Live Astro Compiler

Metadata

Metadata

Assignees

No one assigned

    Labels

    - P4: importantViolate documented behavior or significantly improves performance (priority)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions