Rules
Æsthetic provides a granular set of formatting rules. Rules are a guideline, they control how beautification is to be applied and allow you to structure your code in a uniform way. The default behavior of Æsthetic is to perform beautification in an unobtrusive manner and as such all rules have been pre-defined to produce output which will format in accordance with your provided input. Æsthetic provides several starting-point preset style guides. Presets allow you to change the operating defaults that Æsthetic uses.
Global
Global rules are used are reference point within all supported languages.
Liquid
Beautification rules for the Liquid Template Language. Æsthetic brings an array of beautification rules tailored to its typical usage within Markup languages. These rules are diligently applied in accordance with the specific requirements of Liquid.
Extended Behavior
Liquid rules extend beyond Markup languages, supports for Liquid contained within Style, JSON, and Script languages is also provided but the behavior of Liquid beautification in these non-markup contexts differs slightly. To maintain code preservation, Æsthetic adopts a preservation-based approach when dealing with Liquid in non-markup languages. As a result, only a small subset of Liquid-specific rules will be employed in these scenarios.
Dynamic Determination
To ensure the most refined outcome, Æsthetic dynamically determines which rules to apply in non-markup languages based on the surrounding syntax structure. Rules are cherry-picked to match the specific context, taking into account token placement, positioning, and character matches. This intelligent inference of control enables Æsthetic to deliver precise and cohesive code formatting, regardless of whether Liquid resides within Markup or other language environments.
Ruleset
- CommentIndent
- CommentNewline
- Dedent Tag List
- Delimiter Placement
- Delimiter Trims
- Force Argument
- Force Filter
- Ignore Tag List
- Indent Attributes
- Line Break Separator
- Line Break Style
- Normalize Spacing
- Preserve Comment
- Preserve Internal
- Quote Convert
Markup
Beautification rules for HTML and XML markup languages. Æsthetic exposes a refined set of formatting options for markup syntax to allow developers to generate both basic and complex output using progressive adaption.
Handling
Liquid, JSX and TSX languages reference rules defined in markup and will apply mirror depending on structure occurrence.
Ruleset
- Attribute Casing
- Attribute Sort
- CommentIndent
- CommentNewline
- Delimiter Terminus
- Force Attribute
- Force Indent
- Ignore CSS
- Ignore JS
- Ignore JSON
- Line Break Value
- Preserve Attribute
- Preserve Text
- Preserve Comment
- Quote Convert
- Self Close Space
- Self Close SVG
- Strip Attribute Lines
Style
Ruleset
- At Rule Space
- Brace Padding
- CommentIndent
- CommentNewline
- No Lead Zero
- Property Sort
- Quote Convert
- Selector Sort
- Shorthand Values