Skip to content

HTMLFormatter doesn't format ColocatedHook or ColocatedJS #3999

@RodolfoSilva

Description

@RodolfoSilva

Environment

  • Elixir version (elixir -v): 1.17.2
  • Phoenix version (mix deps): 1.8.1
  • Phoenix LiveView version (mix deps): 1.1.12
  • Operating system: MacOS
  • Browsers you attempted to reproduce this bug on (the more the merrier): All
  • Does the problem persist after removing "assets/node_modules" and trying again? Yes/no: Yes

Actual behavior

Currently, when you add a ColocatedHook or a ColocatedJS inside a HEEx or EX file, the script is not formatted along with the HTML.

Expected behavior

When running mix format, the JS script should also be formatted, instead of only formatting the HTML.
Perhaps add support to format JS within the HTMLFormatter, or introduce a new module to handle it, such as a JSFormatter.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions