{"library":"prettier-plugin-eex","title":"Prettier EEX Plugin","description":"A Prettier plugin that formats .html.eex and .html.leex files used in Elixir/Phoenix projects. Current stable version is 0.6.0. This plugin leverages Prettier's parsing and formatting capabilities to handle Elixir's EEx templates, preserving embedded Elixir expressions while formatting the surrounding HTML. It requires a minimum of Elixir 1.10 and Erlang OTP 22. Key differentiators include support for LiveView .leex files, configurable multiline expression formatting, and seamless integration with Phoenix projects via mix aliases. The plugin is actively maintained with regular bug fixes and breaking changes between major versions.","language":"javascript","status":"active","last_verified":"Sat Apr 25","install":{"commands":["npm install prettier-plugin-eex"],"cli":null},"imports":["// Automatically loaded by Prettier when placed in project root or in .prettierrc plugins","{\n  \"plugins\": [\"prettier-plugin-eex\"],\n  \"overrides\": [{\"files\": \"*.html.eex\", \"options\": { \"parser\": \"html-eex\" }}]\n}","const prettier = require('prettier');\nprettier.format(code, { parser: 'html-eex', plugins: [require('prettier-plugin-eex')] });"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"// 1. Install\n// yarn add -D prettier prettier-plugin-eex\n\n// 2. Create .prettierrc.js in project root\nmodule.exports = {\n  plugins: ['prettier-plugin-eex'],\n  overrides: [\n    {\n      files: ['*.html.eex', '*.html.leex'],\n      options: {\n        parser: 'html-eex',\n        printWidth: 120,\n        eexMultilineLineLength: 100,\n        eexMultilineNoParens: ['link', 'form_for']\n      }\n    }\n  ]\n};\n\n// 3. Format a file\n// npx prettier --write app/**/*.html.eex\n\n// 4. Or use programmatically\nconst prettier = require('prettier');\nconst code = `<%= form_for @changeset, @action, fn f -> %>\\n  <%= text_input f, :name %>\\n<% end %>`;\nconst formatted = prettier.format(code, {\n  parser: 'html-eex',\n  plugins: [require('prettier-plugin-eex')],\n  printWidth: 80\n});\nconsole.log(formatted);","lang":"javascript","description":"Installation and basic usage of prettier-plugin-eex: setting up .prettierrc, formatting EEx files via CLI and programmatic API.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}