{"library":"prettier-custom-html-indent","title":"Prettier Custom HTML Indent","description":"A fork of Prettier (v3.3.2) that adds custom indentation for HTML attributes, which is impossible to achieve via official plugins or options. This package allows setting a specific indentation width for HTML attributes (htmlAttributeIndent) and defining attributes that should stay on the same line as the tag (sameLineAttributes). It supports JavaScript, TypeScript, JSX, CSS, HTML, Vue, Angular, and more. The fork follows Prettier's release cadence and is compatible with Prettier's existing options and plugins. It is actively maintained as a separate package.","language":"javascript","status":"active","last_verified":"Sat Apr 25","install":{"commands":["npm install prettier-custom-html-indent"],"cli":{"name":"prettier","version":null}},"imports":["import prettier from 'prettier-custom-html-indent'","import { format } from 'prettier-custom-html-indent'","import { resolveConfig } from 'prettier-custom-html-indent'"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"import prettier from 'prettier-custom-html-indent';\n\nconst code = `<div class=\"container\" id=\"main\" style=\"display:block\">\\n  <span>Hello</span>\\n</div>`;\n\nconst formatted = prettier.format(code, {\n  parser: 'html',\n  htmlAttributeIndent: 2,\n  sameLineAttributes: ['id'],\n});\n\nconsole.log(formatted);\n// Output:\n// <div class=\"container\"\n//   id=\"main\"\n//   style=\"display:block\"\n// >\n//   <span>Hello</span>\n// </div>","lang":"typescript","description":"Formats HTML with custom attribute indentation (2 spaces) and keeps 'id' on the same line as the tag.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}