Skip to content

Latest commit

 

History

History
58 lines (41 loc) · 1.11 KB

README.md

File metadata and controls

58 lines (41 loc) · 1.11 KB

HeexFormatter

ElixirCI

A code formatter for Heex templates.

⚠️ This project is still in alpha stage. There are several cases yet to be handled.

Installation

add :heex_formatter as dependency

defp deps do
  [
    # ...
    {:heex_formatter, github: "feliperenan/heex_formatter"},
  ]
end

Add it to your projects .formatter.exs file

[
  plugins: [HeexFormatter],
  inputs: [
    # ...
    "*.{heex,ex,exs}",
    "{config,lib,test}/**/*.{heex,ex,exs}"
  ],
]

Now run

mix format

options

line_length

The formatter defaults to a maximum line_length of 98 characters, which can be overwritten with the line_length option in the .formatter file.

Set heex_line_length to only set the line:length for the heex formatter.

[
  # ...omitted
  heex_line_length: 300
]

Inspired by Surface Formatter.