prettier-plugin-yaml
v1.1.2
Published
Additional YAML formatting options for Prettier
Maintainers
Readme
Install
npm install --save-dev prettier-plugin-yamlpnpm add --save-dev prettier-plugin-yamlUsage
Reference prettier-plugin-yaml in your Prettier config:
{
"plugins": [
"prettier-plugin-yaml"
]
}If you’re using any other YAML plugins, make sure prettier-plugin-yaml is listed last.
Options
In addition to Prettier’s built-in options that affect YAML formatting, prettier-plugin-yaml offers additional configuration options.
interface PluginOptions {
/**
* Enforce a single block style for multi-line string values.
*/
yamlBlockStyle?: 'folded' | 'literal' | undefined;
/**
* Enforce a single collection style for maps and sequences.
*/
yamlCollectionStyle?: 'block' | 'flow' | undefined;
/**
* Quote all mapping keys. Removes unnecessary quotes when disabled.
* @default false
*/
yamlQuoteKeys?: boolean | undefined;
/**
* Quote all string values. Removes unnecessary quotes when disabled.
* @default false
*/
yamlQuoteValues?: boolean | undefined;
}Related
License
MIT © Dom Porada
