Skip to content

Can't use NODE_PATH to locate plugins since 3.0 #15025

@mgabeler-lee-6rs

Description

@mgabeler-lee-6rs

Environments:

  • Prettier Version: 3.0.0
  • Running Prettier via: CLI
  • Runtime: Node.js v16
  • Operating System: Linux
  • Prettier plugins (if any): Well that's the issue ...

Steps to reproduce:

Context: trying to update a monorepo pre-commit hook to Prettier 3.0. I've worked through a bunch of issues related to the sync removals, but now I'm left with a change in how Prettier searches for plugins.

In Prettier 2.8.8, I could point it to the central location of the prettier tooling in the monorepo via setting NODE_PATH. But in Prettier 3.x

Expected behavior:

Tries to load plugins from NODE_PATH directories as a fallback.

Actual behavior:

Ignores NODE_PATH when trying to load plugins.

Running under strace suggests that the only directories it looks in are those derived from the target file's directory, or just $PWD in some cases, which is very hard to make work in a monorepo environment.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:cliIssues with Prettier's Command Line Interfacestatus:needs discussionIssues needing discussion and a decision to be made before action can be taken

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions