Skip to content

Plugin autoload doesn't work for packages installed from GitHub and for Yarn PnP #8474

@fisker

Description

@fisker

Environments:

  • Prettier Version: 2.0.5
  • Running Prettier via: CLI
  • Runtime: Node.js v14
  • Operating System: Windows

Steps to reproduce:

yarn add prettier/prettier @prettier/plugin-pug

Expected behavior:

Can format pug file with npx prettier test.pug

Actual behavior:

The CLI can't load pug plugin automatically


Problem should be here, when install from github, ./node_modules/prettier maybe has own node_modules dir, so the autoLoadDir will be ./node_modules/prettier, not expected ./, so we are looking for ./node_modules/prettier/node_modules/@prettier/plugin-* not ./node_modules/@prettier/plugin-* (where the @prettier/plugin-pug is installed).

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:apiIssues with Prettier's Application Programming Interfacearea:plugin apilocked-due-to-inactivityPlease open a new issue and fill out the template instead of commenting.

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions