Files
test-repo/changelog_unreleased/api/pr-8390.md
T
Georgii Dolzhykov 67cbab7f48 Add plugins' parsers to the parser option (#8390)
* Add plugins' parsers to the `parser` option

* Add changelog entry

* Add plugin name to value description

* Update snapshot
2020-05-25 14:03:20 +03:00

694 B

Add plugins' parsers to the parser option (#8390 by @thorn0)

When a plugin defines a language, the parsers specified for this language are now automatically added to the list of valid values of the parser option. This might be useful for editor integrations or other applications that need a list of available parsers.

> yarn add prettier @prettier/plugin-php
const hasPhpParser = prettier
  .getSupportInfo()
  .options.find((option) => option.name === "parser")
  .choices.map((choice) => choice.value)
  .includes("php"); // false in Prettier stable, true in Prettier master