{"id":21708,"library":"prettier-plugin-marko-htmljs","title":"prettier-plugin-marko-htmljs","description":"A Prettier plugin for Marko templates that uses the htmljs-parser (^5) instead of @marko/compiler. Version 0.1.1 is current; development is active with monthly releases. Key differentiators: follows Prettier's HTML formatting rules (empty line collapsing, separate close tags for non-void elements, bracketSameLine support) and supports prettier-ignore comments. Does not support Marko concise mode. Requires Prettier ^3 as a peer dependency.","status":"active","version":"0.1.1","language":"javascript","source_language":"en","source_url":"https://github.com/AngusMorton/prettier-plugin-marko-htmljs","tags":["javascript"],"install":[{"cmd":"npm install prettier-plugin-marko-htmljs","lang":"bash","label":"npm"},{"cmd":"yarn add prettier-plugin-marko-htmljs","lang":"bash","label":"yarn"},{"cmd":"pnpm add prettier-plugin-marko-htmljs","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"peer dependency for parsing Marko files","package":"htmljs-parser","optional":false},{"reason":"peer dependency, requires version ^3","package":"prettier","optional":false}],"imports":[{"note":"No import needed; plugin auto-detects .marko files when configured in .prettierrc.","wrong":"Missing plugin configuration – prettier won't recognize .marko files","symbol":"(plugin)","correct":"// Add to .prettierrc: { \"plugins\": [\"prettier-plugin-marko-htmljs\"] }"}],"quickstart":{"code":"// Install plugin and peer dependencies\nnpm install --save-dev prettier-plugin-marko-htmljs htmljs-parser prettier@^3\n\n// .prettierrc\n{\n  \"plugins\": [\"prettier-plugin-marko-htmljs\"],\n  \"bracketSameLine\": false,\n  \"singleAttributePerLine\": false\n}\n\n// Format all .marko files\nnpx prettier --write \"**/*.marko\"","lang":"javascript","description":"Install and configure the plugin, then run prettier on Marko files."},"warnings":[{"fix":"Use this plugin exclusively for Marko formatting; do not mix with prettier-plugin-marko.","message":"Not compatible with @marko/compiler-based formatting; behavior diverges on empty lines and void elements.","severity":"gotcha","affected_versions":">=0.0.0"},{"fix":"Write all templates in HTML-like (non-concise) mode.","message":"Concise mode syntax is untested and may produce invalid output.","severity":"deprecated","affected_versions":">=0.0.0"},{"fix":"Wrap content in a div or other container to use prettier-ignore.","message":"prettier-ignore only works on elements with a closing tag; self-closing elements cannot be ignored.","severity":"gotcha","affected_versions":">=0.0.0"},{"fix":"Use prettier-ignore on the <pre> element or its parent.","message":"May reformat <pre> tag content despite prettier-ignore missing; known issue.","severity":"breaking","affected_versions":">=0.0.0"}],"env_vars":null,"last_verified":"2026-04-27T00:00:00.000Z","next_check":"2026-07-26T00:00:00.000Z","problems":[{"fix":"npm install --save-dev htmljs-parser","cause":"Missing peer dependency htmljs-parser","error":"Error: Cannot find module 'htmljs-parser'"},{"fix":"npm install --save-dev prettier-plugin-marko-htmljs","cause":"Plugin not installed or not listed in package.json","error":"Error: Cannot find module 'prettier-plugin-marko-htmljs'"},{"fix":"Rewrite template using HTML-like syntax with explicit tags.","cause":"Using concise mode syntax which is unsupported","error":"[error] .marko: SyntaxError: Expected attribute value but got \"<\""}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}