A Prettier plugin for formatting .html.erb files, currently at version 0.4.0. It integrates with Prettier (>=2.0.0 <2.3) and depends on @prettier/plugin-ruby for formatting multiline Ruby expressions. Key differentiators: allows ERB formatting within Prettier's ecosystem, supports single-line expressions, and includes basic comment handling. The plugin is relatively new with limited features (no block expression formatting yet) and may have bugs; users are encouraged to ignore problematic files via .prettierignore.
npm install prettier-plugin-erbVerified import paths — ran on the pinned version, not inferred.
Shows installation, configuration in .prettierrc, and CLI usage for formatting .html.erb files.
Use Prettier version 2.2.x or lower. Check peerDependencies: prettier >=2.0.0 <2.3.
Upgrade to v0.2.0+ for single-line expressions; block expressions still not supported in any version.
Upgrade to v0.4.0 or later.
Upgrade to v0.2.0+ if you rely on error formatting.
Use .prettierignore to exclude files that cause errors or unwanted formatting.
Downgrade Prettier to version 2.2.x or lower.
Install the missing peer: `yarn add -D @prettier/plugin-ruby`
Upgrade to version 0.4.0 or later.
Remove or rewrite block expressions as single-line ERB, or add file to .prettierignore.