Skip to content

[Feature] Template tag expression formatting configuration option(s) #338

@colinciesla

Description

@colinciesla

💬 Describe the Feature

Add support to format template tag expressions such that template tag blocks start on an indented newline and sub-elements have block indentation. Add a configuration option to turn on or off and possibly add an option to adjust block indentation.

🔬 Use Case

As a developer, I may want my template tag expressions to be formatted so that the template tag blocks have their own section for better visual clarity.

Current Implementation

To my knowledge template tag expressions only format in two ways:

Single-line

const ApplicationTemplate: TOC<ApplicationSignature> = <template><h1>Hello World!</template>;

Multi-line with opening template tag on same line as left-hand argument

const ApplicationTemplate: TOC<ApplicationSignature> = <template>
  <main>
    <h1>Hello World!</h1>
  <main>
</template>;

Proposed Change

This change would allow a developer to change the formatting to this:

Newline with block indentation of 2 (my ideal default)

const ApplicationTemplate: TOC<ApplicationSignature> =
  <template>
    <main>
      <h1>Hello World!</h1>
    <main>
  </template>;

Newline with block indentation of 0

const ApplicationTemplate: TOC<ApplicationSignature> =
<template>
  <main>
    <h1>Hello World!</h1>
  <main>
</template>;

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions