babel / babel/website

Pass Babel AST to Prettier rather than re-parsing

Open
#1,312 0 comments 0 reactions 1 assignee Claimed by @azz View on GitHub
repl
Dominant language
TypeScript
Stars
777
Forks
1.4k
Avg merge
16h 45m
Merged PRs (30d)
3

Description

See _TODO_ comments in `js/repl/src/compile`.

It would be more efficient to pass Prettier the AST Babel has already created. However we can't do this until we upgrade to Babel 7 (since that's what Prettier uses).

It also seems suboptimal that Prettier only exposes this functionality behind a `__debug` property (`prettier.__debug.formatAST`). Maybe we could reach out to the Prettier team about a more formal API for this?

This is a follow-up item for PR #1297

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.