Registry / serialization / prettier-plugin-eta

prettier-plugin-eta

JSON →
library0.2.11jsnpmunverified

Prettier plugin for formatting Eta template files (`.eta`) with full-document support. Version 0.2.11, released periodically on GitHub. Formats JavaScript inside Eta tags using babel-ts and surrounding HTML via Prettier's HTML parser, preserving trim markers and template literals. Honors standard Prettier options. Also exposes an Eta-aware HTML tag matcher for editor tooling.

npm install prettier-plugin-eta
INSTALL
IMPORT
SIG · PRETTIER-PLUGIN-ET
P
prettier-plugin-eta
serializationjavascriptv0.2.11
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
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
musl
node 18226 runs
build_error
glibc
node 18226 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>
Debug
Known issues
gotchaRange formatting is intentionally out of scope; formatting must be full-document.
fix
Use `--range-start` and `--range-end` with caution; the plugin may ignore range requests.
affects: >=0.2.9
gotchaRequires Prettier v3.0.0 or higher; does not work with Prettier v2.
fix
Ensure prettier version is ^3.0.0 in your package.json.
affects: >=0.2.9
deprecatedThe plugin is still actively maintained but the repository is labeled as 'eta-template-language' with multiple components.
fix
No action needed, but be aware of potential name changes in the future.
affects: >=0.2.9
Errors
Common errors & fixes
Error: Cannot find module 'prettier-plugin-eta'
Plugin not installed or not in node_modules.
fix
Run `npm install --save-dev prettier prettier-plugin-eta`
Error: Plugin prettier-plugin-eta not found
Prettier config file does not include the plugin correctly.
fix
Add '"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.
fix
Ensure the source string is a valid Eta template and contains matching HTML tags.
Upgrade
Version history
0.2.11latest on npm
Audit
Dependencies
prettierrequiredPeer dependency required for the plugin to function
Agent activity
4 hits · last 30 days
node
4
Resources
prettier-plugin-eta — npm install prettier-plugin-eta · libregistry