Visitar URL original
estree.d.ts is not a module · Issue #15017 · prettier/prettier · GitHub
Skip to content

estree.d.ts is not a module #15017

Closed
Closed

Description

@kingyue737

Environments:

  • Prettier Version: 3.0.0
  • Running Prettier via: Browser API
  • Runtime: Chrome 114
  • Operating System: Windows
  • Prettier plugins (if any): built-in estree and babel plugin

Steps to reproduce:

I'm using standalone prettier to format code text in browser
image

Import prettier/plugins/estree in source code will raise typescript error:

File './node_modules/.pnpm/prettier@3.0.0/node_modules/prettier/plugins/estree.d.ts' is not a module.ts(2306)

Expected behavior:
No type error

Actual behavior:
I found estree.d.ts is an empty file

Activity

  1. fisker commented on Jul 6, 2023

    @fisker
    Member

    // We only add `parsers` to types file, printers should not be used alone
    // For `estree` plugin, we just write an empty file

    Any idea how to fix it?

  2. kingyue737 commented on Jul 6, 2023

    @kingyue737
    ContributorAuthor

    @fisker Add the following line can fix it

    // estree.d.ts
    export {}

    Adding this in the declaration file seems to be a routine operation to ensure it treated as a module
    https://router.vuejs.org/guide/advanced/meta.html#typescript

  3. fisker commented on Jul 6, 2023

    @fisker
    Member

    Would you like to send a PR?

  4. added
    type:metaIssues about the status of Prettier, or anything else about Prettier itself
    on Jul 6, 2023
  5. locked as resolved and limited conversation to collaborators on Nov 24, 2023
  6. added theissue type on Mar 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    locked-due-to-inactivityPlease open a new issue and fill out the template instead of commenting.type:metaIssues about the status of Prettier, or anything else about Prettier itself

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions