A Prettier plugin for formatting Neos Fusion files.
npm install --save-dev prettier prettier-plugin-neos-fusion
# or
yarn add -D prettier prettier-plugin-neos-fusionAdd the plugin to your Prettier config:
{
"plugins": ["prettier-plugin-neos-fusion"]
}To use 2-space indentation for Fusion files (recommended):
{
"plugins": ["prettier-plugin-neos-fusion"],
"overrides": [
{
"files": "**/*.fusion",
"options": {
"tabWidth": 2
}
}
]
}- Prototype declarations and inheritance (
prototype(Foo:Bar) < prototype(Neos.Fusion:Component)) - Property assignments (
key = value) - All value types: strings, booleans, integers, floats, null, EEL expressions (
${...}), Fusion object types - DSL expressions (
afx\...``) — re-indented to match the surrounding context - Value copy (
<) and unset (>) operations include:statements@metaproperties- Blank lines between property groups are preserved
//,#, and/* */comments
Install the Prettier - Code formatter extension. Once the plugin is in your node_modules and registered in .prettierrc, format-on-save works automatically for .fusion files.