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

SyntaxError Export is not defined when exporting variable inside a module declaration #213

Open
DetachHead opened this issue Feb 27, 2023 · 0 comments

Comments

@DetachHead
Copy link

Your Environment

  • Prettier version: 2.8.4
  • node version: 19.2.0
  • package manager: npm@8.19.3
  • IDE: vscode

Describe the bug

in typescript, when exporting a variable declared within a declare module block, prettier fails with a SyntaxError

To Reproduce

declare module 'foo' {
    const a: 1
    export { a }
}

Expected behavior
no error

Error log

> prettier asdf.ts
asdf.ts[error] asdf.ts: SyntaxError: Export 'a' is not defined. (3:13)
[error]   1 | declare module 'foo' {
[error]   2 |     const a: 1
[error]   3 |     export { a }
[error]   4 | }
[error]   5 |
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant