/** * annealer * * @description Reorders HTML/Vue attributes by semantic meaning using swappable YAML profiles. * @author Logue * @license MIT * @version 0.1.0-alpha.1 * @see {@link https://github.com/logue/annealer} */ import type { Language } from './Language.js'; /** Options for `format`. */ export type FormatOptions = { /** Input language. */ language?: Language; /** * A built-in profile name (`html`, `vue`) or the YAML text of a profile. * Defaults to the built-in profile for `language`. */ profile?: string; /** * Order of the classes in static `class` attributes: a built-in class order * name (`tailwind`) or the YAML text of a class order. Overrides the * profile's `classOrder`; by default classes keep their order. */ classOrder?: string; /** * Self-closes empty elements and components in Vue templates * (`layout.selfClosing.normal`/`component`, `vue/html-self-closing`): * `
`, ``. `false` turns that off. By default the profile's * setting is kept (off in the built-in profiles). Void elements (`
`) * follow `voidSelfClosing`. */ selfClosing?: boolean; /** * Writes void elements (`input`, `meta`, `br`, …) self-closing, `` * (`layout.selfClosing.void: always`); `false` drops the slash, `` * (`never`). By default the profile's setting is kept (`always` in the * built-in profiles). */ voidSelfClosing?: boolean; /** * In plain HTML, gives non-void elements written self-closing an end tag: * `
` → `
` (`layout.selfClosing.expandNonVoid`). HTML * ignores the slash, so `
` leaves the element open. Elements inside * `` and ``, where self-closing is valid, are left alone. By * default the profile's setting is kept (off in the built-in profiles). */ expandNonVoid?: boolean; /** * Puts the content of multiline elements on lines of its own * (`vue/multiline-html-element-content-newline`), with the rule's defaults * when the profile has no `layout.contentNewline`. `false` turns it off. By * default the profile's setting is kept (off in the built-in profiles). */ contentNewline?: boolean; /** * Drops repeated classes in static `class` attributes, keeping the first. * Works with or without `classOrder`. `false` keeps them. By default the * class order's `removeDuplicates` is kept (off in `tailwind`, and off * without a class order). */ removeDuplicateClasses?: boolean; /** * Line width of stylesheets and `