* Add plugins' parsers to the `parser` option * Add changelog entry * Add plugin name to value description * Update snapshot
694 B
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