{"id":20362,"library":"prettier-plugin-eta","title":"prettier-plugin-eta","description":"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.","status":"active","version":"0.2.11","language":"javascript","source_language":"en","source_url":"https://github.com/JoobyPM/eta-template-language","tags":["javascript","eta","prettier","prettier-plugin","template","html","typescript"],"install":[{"cmd":"npm install prettier-plugin-eta","lang":"bash","label":"npm"},{"cmd":"yarn add prettier-plugin-eta","lang":"bash","label":"yarn"},{"cmd":"pnpm add prettier-plugin-eta","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Peer dependency required for the plugin to function","package":"prettier","optional":false}],"imports":[{"note":"This is a Prettier plugin, not a library. It must be listed in Prettier's plugins config.","wrong":"import { prettierPluginEta } from 'prettier-plugin-eta'","symbol":"prettier-plugin-eta","correct":"add 'prettier-plugin-eta' to plugins array in Prettier config (e.g., .prettierrc)"},{"note":"The tag matcher is a secondary export from a separate entry point.","wrong":"import { findMatchingHtmlTag } from 'prettier-plugin-eta'","symbol":"findMatchingHtmlTag","correct":"import { findMatchingHtmlTag } from 'prettier-plugin-eta/html-tag-matcher'"},{"note":"TypeScript types are shipped; ESM import works. CommonJS require may also work but is not recommended.","wrong":"const plugin = require('prettier-plugin-eta')","symbol":"default import","correct":"import plugin from 'prettier-plugin-eta'"}],"quickstart":{"code":"// .prettierrc\n{\n  \"plugins\": [\"prettier-plugin-eta\"],\n  \"printWidth\": 100,\n  \"singleQuote\": true,\n  \"tabWidth\": 2\n}\n\n// Run:\n// npx prettier --write \"views/**/*.eta\"\n\n// Example Eta template (input.eta):\n// <html>\n//   <body>\n//     <%= it.users.map(u => u.name).join(', ') %>\n//   </body>\n// </html>\n\n// After formatting (output.eta):\n// <html>\n//   <body>\n//     <%= it.users.map((u) => u.name).join(\", \") %>\n//   </body>\n// </html>","lang":"typescript","description":"Install the plugin, configure it in .prettierrc, and format .eta files with Prettier."},"warnings":[{"fix":"Use `--range-start` and `--range-end` with caution; the plugin may ignore range requests.","message":"Range formatting is intentionally out of scope; formatting must be full-document.","severity":"gotcha","affected_versions":">=0.2.9"},{"fix":"Ensure prettier version is ^3.0.0 in your package.json.","message":"Requires Prettier v3.0.0 or higher; does not work with Prettier v2.","severity":"gotcha","affected_versions":">=0.2.9"},{"fix":"No action needed, but be aware of potential name changes in the future.","message":"The plugin is still actively maintained but the repository is labeled as 'eta-template-language' with multiple components.","severity":"deprecated","affected_versions":">=0.2.9"}],"env_vars":null,"last_verified":"2026-04-25T00:00:00.000Z","next_check":"2026-07-24T00:00:00.000Z","problems":[{"fix":"Run `npm install --save-dev prettier prettier-plugin-eta`","cause":"Plugin not installed or not in node_modules.","error":"Error: Cannot find module 'prettier-plugin-eta'"},{"fix":"Add '\"plugins\": [\"prettier-plugin-eta\"]' to your .prettierrc","cause":"Prettier config file does not include the plugin correctly.","error":"Error: Plugin prettier-plugin-eta not found"},{"fix":"Ensure the source string is a valid Eta template and contains matching HTML tags.","cause":"The `findMatchingHtmlTag` function was called without proper Eta syntax or outside a template.","error":"TypeError: Cannot read properties of undefined (reading 'match')"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}