Skip to content

Web Console (Beta): Saving LWC HTML results in Prettier quoting template syntax #7246

@aheber

Description

@aheber

Summary

Using the new Web Console (Beta) to complete a Trailhead challenge is awesome! Much better than building a temporary connection to my computer via the CLI.

When working through this, https://trailhead.salesforce.com/content/learn/modules/javascript-developer-certification-maintenance-summer-25/put-html-class-binding-into-practice?trail_id=maintain-your-salesforce-certifications, I saved the HTML file and where I had set the attribute as class={computedClassNames}, Prettier reformatted to class="{computedClassNames}".

I'm unable to install additional modules to get this setup correctly on my own, I would also really expect this to be setup correctly from the start in this context.

Steps To Reproduce:

  1. Enable and open Web Console.
  2. Complete the linked Trailhead.
  3. When saving the changes to the HTML for the final challenge, the content is corrupted.

Expected result

I would expect the template syntax to be left unquoted. This is because Prettier is using the HTML parser when it should be using the LWC parser.

Additional information

Correct LWC Prettier setup is documented here: https://developer.salesforce.com/docs/platform/sfvscode-extensions/guide/prettier.html

Salesforce Extension Version in VS Code:
Web Console

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