Skip to content

getSupportInfo misinform about babel/babylon #5822

@CiGit

Description

@CiGit

Since 1.16 and the name change babylon -> babel, getSupportInfo returns "babel" as a valid parser for JS, Flow, JSX language. Of course, babel is not a valid parser with prettier < 1.16.
This appeared in prettier-vscode.
We have a current workaround, sadly it doesn't work with prettier < 1.8 (where getSupportInfo doesn't exist)
Changing prettier.getSupportInfo(otherPrettier.version) to otherPrettier.getSupportInfo()

context:
prettier/prettier-vscode#705
prettier/prettier-vscode#706

Environments:

  • Prettier Version: 1.16.3
  • Running Prettier via: API
  • Runtime: Node 8+
  • Operating System: ALL

Steps to reproduce:

require("prettier").getSupportInfo("0.0.0").languages.find(l=>l.name === "JavaScript").parsers

Expected behavior:
[ 'babylon', 'flow' ]

Actual behavior:
[ 'babel', 'flow' ]

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:apiIssues with Prettier's Application Programming Interfacelocked-due-to-inactivityPlease open a new issue and fill out the template instead of commenting.priority:highCode is printed in a way that alters the AST, breaks syntax, or is a significant regression. Urgent!status:has prIssues with an accompanying pull request. These issues will probably be fixed soon!

    Type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions