A fast and precise formatter for ERB (Embedded Ruby) files with editor integration and configurable line length.
ERB::Formatter is a Ruby gem that automatically formats ERB (Embedded Ruby) files with speed and precision. It solves the problem of inconsistent formatting in ERB templates by providing a reliable formatter that handles both HTML and embedded Ruby code, making view files more readable and maintainable.
Ruby on Rails developers working with ERB templates, frontend developers maintaining Rails views, and teams wanting consistent code formatting across their ERB files.
Developers choose ERB::Formatter for its fast performance, Prettier-like output quality, and excellent editor integration capabilities, providing a specialized formatting solution specifically designed for ERB files.
Format ERB files with speed and precision
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
The README highlights 'very fast' formatting, ensuring minimal disruption to development workflows, as evidenced by its efficient command-line performance.
It aims to produce HTML formatting similar to Prettier, providing a consistent and aesthetic code style that aligns with frontend standards, as mentioned in the features list.
Correctly handles Ruby syntax within ERB, such as indenting if/elsif/do/end blocks, demonstrated in the command-line example that shows proper nesting.
Offers ready-to-use configurations for VSCode, Vim, Zed, and others, making it easy to incorporate into diverse development environments, with detailed setup guides in the README.
Currently only supports configurable line length; more advanced formatting rules are on the roadmap but not available, restricting teams with strict style guides.
The roadmap admits missing features like JavaScript and CSS formatting, and fixes for spaces after attribute equal signs, which can leave parts of templates unformatted or cause formatting gaps.
READ ME states it gives meaningful error output 'most of the time,' implying reliability issues in edge cases that could frustrate developers during formatting failures.