JoshuaKGoldberg / JoshuaKGoldberg/formatly

🐛 Bug: Prettier's internal CLI is never loaded on Prettier 3.6 and up

Open Beginner friendly
#574 0 comments 1 reaction 0 assignees View on GitHub
type: bug
Dominant language
TypeScript
Stars
47
Forks
3
Avg merge
34m
Merged PRs (30d)
38

Description

> [pending] will clean up this text

### Bug Report Checklist

- [x] I have tried restarting my IDE and the issue persists.
- [x] I have pulled the latest `main` branch of the repository.
- [x] I have [searched for related issues](https://github.com/JoshuaKGoldberg/formatly/issues?q=is%3Aissue) and found none that matched my issue.

### Expected

`runPrettier` formats in memory by requiring `prettier/internal/cli.mjs` whenever Prettier is installed.

### Actual

Prettier 3.6 split that file into `internal/legacy-cli.mjs` and `internal/experimental-cli.mjs`, so the require always throws and every consumer on 3.6 or later silently falls back to spawning a child process.

### Additional Info

Confirmed absent in 3.6.0, 3.7.0, 3.8.0, 3.9.0, and 3.9.6, and present in 3.0 through 3.5. Found while working on #563.

Contributor guide

Open the contributing guide

Research direction

Start at the runPrettier entry point and inspect how it requires Prettier's internal CLI module. Verify the module selection against Prettier 3.0 through 3.5 and 3.6 and later, then confirm that in-memory formatting works for newer versions without silently falling back to a child process.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
tooling
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
68/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.