Prettier Plugin for EdgeJS

raw JSON →
1.0.7 verified Sat Apr 25 auth: no javascript maintenance

A Prettier plugin for formatting EdgeJS (.edge) template files, an opinionated formatter maintained by the community. Current version 1.0.7 is stable but in maintenance mode with no active feature development. It supports standard Prettier options like useTabs, printWidth, tabWidth, singleAttributePerLine, and custom single-line edge tags. Key differentiator: it is the only dedicated formatter for EdgeJS templates, handling HTML, Edge tags, and embedded script/style blocks. Release cadence is low; updates depend on community contributions. Works alongside Prettier and requires Prettier installed.

error Cannot find module 'prettier-plugin-edgejs'
cause Plugin not installed or not in node_modules.
fix
Run: npm i prettier prettier-plugin-edgejs --save-dev
error No parser could be inferred for file: example.edge
cause Plugin not added to Prettier config or file not recognized.
fix
Ensure 'plugins' array in .prettierrc.json includes 'prettier-plugin-edgejs'.
error Invalid option 'customSingleLineEdgeTags'. Expected an array of strings.
cause Option set to a string instead of an array.
fix
Set customSingleLineEdgeTags to an array, e.g., ["@reverse"].
error Cannot destructure property 'printWidth' of 'userOptions' as it is undefined.
cause Outdated version or misconfiguration; possibly missing Prettier peer dep.
fix
Update prettier and the plugin: npm update prettier prettier-plugin-edgejs
deprecated Project is in maintenance mode; no active feature development.
fix Consider forking or contributing if you need new features.
gotcha Script and style tags with EdgeJS tags are only supported 1 level deep. Deeper nesting may not format correctly.
fix Avoid deeply nested Edge tags inside <script> or <style> blocks.
gotcha Attribute values are not formatted for spacing; they are preserved as-is.
fix Manually format attribute values if needed.
gotcha Editor extensions may require restart after adding the plugin to config.
fix Restart your editor or Prettier extension.
gotcha If printWidth is exceeded on an HTML tag, plugin forces singleAttributePerLine regardless of the setting.
fix Set a higher printWidth to avoid automatic single attribute per line.
npm install prettier-plugin-edgejs
yarn add prettier-plugin-edgejs
pnpm add prettier-plugin-edgejs

Installation and basic configuration for formatting .edge files with Prettier.

// 1. Install: npm i prettier prettier-plugin-edgejs
// 2. Create .prettierrc.json:
{
  "plugins": ["prettier-plugin-edgejs"],
  "printWidth": 80,
  "tabWidth": 4,
  "useTabs": false,
  "singleAttributePerLine": false,
  "customSingleLineEdgeTags": []
}
// 3. Format: npx prettier --write "**/*.edge"