Skip to content

formatter: Diff with Prettier on one-line angular template #18891

@Hinton

Description

@Hinton

Input

import { Component } from "@angular/core";

@Component({
  template: `<ng-content></ng-content>`,
})
export class Component {}

Config

{
  "printWidth": 100,
  "overrides": [
    {
      "files": ["*.mdx"],
      "options": {
        "proseWrap": "always"
      }
    }
  ]
}

Oxfmt output

Oxfmt version: 0.28.0

import { Component } from "@angular/core";

@Component({
  template: `
    <ng-content></ng-content>
  `,
})
export class Component {}

Oxfmt playground link

No response

Prettier output

Prettier version: 864bb7c042d9935344c155ad9292de3213e0085b

import { Component } from "@angular/core";

@Component({
  template: `<ng-content></ng-content>`,
})
export class Component {}

Prettier playground link

https://prettier.io/playground/#N4Igxg9gdgLgprEAuEBLAtgBwgJxgAmHwGEItoECBffAMxzPwB0QABAQygHMBXAG3Y4A9JBxwWAbiZRprUuSiUAFMGn588LAPhJ8AAwA83ALSRYlAHwGhJs-FgW9AGmlUAlNLgAPbHnxgBAGdAkjJsRVhCKhAnEAhMGFRoQORQQQYAdwAFQQQUlHY+DPYATxTYgCMcdjAAazgYAGV2dDgAGVRFZFpCwLhYiAqAKzgwGAB1asxkEEwxPpwANzgYkCqa+qbMGs6uZBgcHn6QPvRUfcPj70w4HAxKQoB5G+qYXCyIQNRE6BmEABNVtdbvdYIUACq3KCCVBwfI9Ph9WJfbh8OAARR4EHg3V6xyGgS8jV2aMx2JWSARSJAAEcsfAsgxMPkQOxAsZFHB-lzVgd2Kg+Lt5Oh2DNCnxViiuGiAIIwA6oCo8Bm3DpdSl42IACxg6D44y13zh2zAcEaeW+qEW3xKMzAwVWiyOAEkoNzYI0wHcEjK3Y0YCU0bjEcc5p84JN2NMUHM4bdlkC3Y9aGqKSA+LRVp0FjBGewuCLg9TtjgFjMAzdAl7UAlVnNOhNUP8YFrkABGAAMHdiYjpqDEeYLoo1IdiMHYFXGTZbyAATLEeH1wRP4ZqQHB0BUudz-m1OLx83AAGK4EXy3Zi5UQEBUKhAA

Additional notes

For some reason the playground produces the expected output but running it locally does not.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    Priority

    None yet

    Effort

    None yet

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions