-
-
Notifications
You must be signed in to change notification settings - Fork 4.7k
getSupportInfo misinform about babel/babylon #5822
Copy link
Copy link
Labels
area:apiIssues with Prettier's Application Programming InterfaceIssues with Prettier's Application Programming Interfacelocked-due-to-inactivityPlease open a new issue and fill out the template instead of commenting.Please 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!Code 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!Issues with an accompanying pull request. These issues will probably be fixed soon!
Milestone
Metadata
Metadata
Assignees
Labels
area:apiIssues with Prettier's Application Programming InterfaceIssues with Prettier's Application Programming Interfacelocked-due-to-inactivityPlease open a new issue and fill out the template instead of commenting.Please 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!Code 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!Issues with an accompanying pull request. These issues will probably be fixed soon!
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)tootherPrettier.getSupportInfo()context:
prettier/prettier-vscode#705
prettier/prettier-vscode#706
Environments:
Steps to reproduce:
Expected behavior:
[ 'babylon', 'flow' ]Actual behavior:
[ 'babel', 'flow' ]