{"id":20352,"library":"prettier-plugin-edgejs","title":"Prettier Plugin for EdgeJS","description":"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.","status":"maintenance","version":"1.0.7","language":"javascript","source_language":"en","source_url":"https://github.com/sajansharmanz/prettier-plugin-edgejs","tags":["javascript","edge","edgejs","prettier","plugin","typescript"],"install":[{"cmd":"npm install prettier-plugin-edgejs","lang":"bash","label":"npm"},{"cmd":"yarn add prettier-plugin-edgejs","lang":"bash","label":"yarn"},{"cmd":"pnpm add prettier-plugin-edgejs","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"peer dependency; the plugin extends Prettier and requires it at runtime.","package":"prettier","optional":false}],"imports":[{"note":"This is a Prettier plugin, not a library. You do not import it in code; you reference it in your Prettier config file.","wrong":"import prettierPluginEdgejs from 'prettier-plugin-edgejs'","symbol":"(plugin)","correct":"Add 'prettier-plugin-edgejs' to plugins array in Prettier config."},{"note":"Correct usage: add plugin name as a string in plugins array. No import statement needed.","wrong":"{\n  \"plugins\": [\"prettier-plugin-edgejs\", {}, {}]\n}","symbol":"config","correct":"{\n  \"plugins\": [\"prettier-plugin-edgejs\"]\n}"},{"note":"customSingleLineEdgeTags must be an array of strings, not a single string.","wrong":"{\n  \"plugins\": [\"prettier-plugin-edgejs\"],\n  \"customSingleLineEdgeTags\": \"@reverse\"\n}","symbol":"options","correct":"{\n  \"plugins\": [\"prettier-plugin-edgejs\"],\n  \"customSingleLineEdgeTags\": [\"@reverse\"]\n}"}],"quickstart":{"code":"// 1. Install: npm i prettier prettier-plugin-edgejs\n// 2. Create .prettierrc.json:\n{\n  \"plugins\": [\"prettier-plugin-edgejs\"],\n  \"printWidth\": 80,\n  \"tabWidth\": 4,\n  \"useTabs\": false,\n  \"singleAttributePerLine\": false,\n  \"customSingleLineEdgeTags\": []\n}\n// 3. Format: npx prettier --write \"**/*.edge\"","lang":"javascript","description":"Installation and basic configuration for formatting .edge files with Prettier."},"warnings":[{"fix":"Consider forking or contributing if you need new features.","message":"Project is in maintenance mode; no active feature development.","severity":"deprecated","affected_versions":">=1.0.0"},{"fix":"Avoid deeply nested Edge tags inside <script> or <style> blocks.","message":"Script and style tags with EdgeJS tags are only supported 1 level deep. Deeper nesting may not format correctly.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Manually format attribute values if needed.","message":"Attribute values are not formatted for spacing; they are preserved as-is.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Restart your editor or Prettier extension.","message":"Editor extensions may require restart after adding the plugin to config.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Set a higher printWidth to avoid automatic single attribute per line.","message":"If printWidth is exceeded on an HTML tag, plugin forces singleAttributePerLine regardless of the setting.","severity":"gotcha","affected_versions":">=1.0.0"}],"env_vars":null,"last_verified":"2026-04-25T00:00:00.000Z","next_check":"2026-07-24T00:00:00.000Z","problems":[{"fix":"Run: npm i prettier prettier-plugin-edgejs --save-dev","cause":"Plugin not installed or not in node_modules.","error":"Cannot find module 'prettier-plugin-edgejs'"},{"fix":"Ensure 'plugins' array in .prettierrc.json includes 'prettier-plugin-edgejs'.","cause":"Plugin not added to Prettier config or file not recognized.","error":"No parser could be inferred for file: example.edge"},{"fix":"Set customSingleLineEdgeTags to an array, e.g., [\"@reverse\"].","cause":"Option set to a string instead of an array.","error":"Invalid option 'customSingleLineEdgeTags'. Expected an array of strings."},{"fix":"Update prettier and the plugin: npm update prettier prettier-plugin-edgejs","cause":"Outdated version or misconfiguration; possibly missing Prettier peer dep.","error":"Cannot destructure property 'printWidth' of 'userOptions' as it is undefined."}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}