Skip to content

[ts-transformers] Improve position of static properties and add blank line #2159

Open
@aomarks

Description

@aomarks

Input

class MyElement extends LitElement {
  static styles = css`...`;

  @property()
  foo;
}

Current output

class MyElement extends LitElement {
  static properties = {
    foo: {},
  }
  static styles = css`...`;
}

Desired output

class MyElement extends LitElement {
  static styles = css`...`;

  static properties = {
    foo: {},
  }
}

Specifically, we should:

  • When creating a new static properties field, put it below the last existing static field, instead of at the top of the class.
  • Add a blank-line placeholder to new static properties fields.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    Status

    📋 Triaged

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions