Skip to content

medienreaktor/prettier-plugin-neos-fusion

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

prettier-plugin-neos-fusion

A Prettier plugin for formatting Neos Fusion files.

Installation

npm install --save-dev prettier prettier-plugin-neos-fusion
# or
yarn add -D prettier prettier-plugin-neos-fusion

Configuration

Add 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
      }
    }
  ]
}

What it formats

  • 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
  • @meta properties
  • Blank lines between property groups are preserved
  • //, #, and /* */ comments

VS Code

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.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors