2.0.2 • Published 2 years ago
@afshinhaghighat/prettier-plugin-twig-melody v2.0.2
Prettier for Melody

This plugin for Prettier is a fork of prettier-plugin-twig-melody, which is currently unmaintained and @supersoniks/prettier-plugin-twig-melody with serveral enhancements. The newer version of prettier has removed multiple deprecated methods and functions, and led to several issues which are fixed in this repo.
Install
yarn add --dev @afshinhaghighat/prettier-plugin-twig-melodyor
npm install --save-dev @afshinhaghighat/prettier-plugin-twig-melodyUse
prettier --write "**/*.melody.twig"In your editor, if the plugin is not automatically picked up and invoked (e.g., if you are using format on save, but no formatting is happening when you save), try adding the plugin explicitly in your Prettier configuration (e.g., .prettierrc.json) using the plugins key:
{
"printWidth": 80,
"tabWidth": 4,
"plugins": ["./node_modules/@afshinhaghighat/prettier-plugin-twig-melody"]
}Enhancements
- Preserve
onlykeyword in twig templates. - Block statements : no empty line between opening end closing
blockstatements. - Html element : nno empty line between opening and closing tags.
- Updated
npmpackages to the latest version:Prettier 3.0.0is now included and issues related are fixed