Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
muslnode 18–226 runs
build_error
glibcnode 18–226 runs
build_error
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
prettier-plugin-eta
✓ add 'prettier-plugin-eta' to plugins array in Prettier config (e.g., .prettierrc)
✗ import { prettierPluginEta } from 'prettier-plugin-eta'
This is a Prettier plugin, not a library. It must be listed in Prettier's plugins config.
findMatchingHtmlTag
✓ import { findMatchingHtmlTag } from 'prettier-plugin-eta/html-tag-matcher'
✗ import { findMatchingHtmlTag } from 'prettier-plugin-eta'
The tag matcher is a secondary export from a separate entry point.
default import
✓ import plugin from 'prettier-plugin-eta'
✗ const plugin = require('prettier-plugin-eta')
TypeScript types are shipped; ESM import works. CommonJS require may also work but is not recommended.
Install the plugin, configure it in .prettierrc, and format .eta files with Prettier.
// .prettierrc
{
"plugins": ["prettier-plugin-eta"],
"printWidth": 100,
"singleQuote": true,
"tabWidth": 2
}
// Run:
// npx prettier --write "views/**/*.eta"
// Example Eta template (input.eta):
// <html>
// <body>
// <%= it.users.map(u => u.name).join(', ') %>
// </body>
// </html>
// After formatting (output.eta):
// <html>
// <body>
// <%= it.users.map((u) => u.name).join(", ") %>
// </body>
// </html>
Errors
Common errors & fixes
Error: Cannot find module 'prettier-plugin-eta'
Plugin not installed or not in node_modules.
fixRun `npm install --save-dev prettier prettier-plugin-eta`
Error: Plugin prettier-plugin-eta not found
Prettier config file does not include the plugin correctly.
fixAdd '"plugins": ["prettier-plugin-eta"]' to your .prettierrc
TypeError: Cannot read properties of undefined (reading 'match')
The `findMatchingHtmlTag` function was called without proper Eta syntax or outside a template.
fixEnsure the source string is a valid Eta template and contains matching HTML tags.
Audit
Dependencies
prettierrequiredPeer dependency required for the plugin to function