Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

prettier not formatting things correctly #48

Open
jaxramus opened this issue May 30, 2022 · 0 comments
Open

prettier not formatting things correctly #48

jaxramus opened this issue May 30, 2022 · 0 comments

Comments

@jaxramus
Copy link

jaxramus commented May 30, 2022

I am using https://github.com/prettier/prettier with the default settings

For example, let's say I have this:

render() {
    return html`<div><h1>Hello</h1><p>I love coding.</p></div>`
}

Prettier correctly formats it to this:

render() {
    return html`<div>
        <h1>Hello</h1>
        <p>I love coding.</p>
    </div>`;
}

Now let's say I have this:

render() {
    return /*html*/`<div><h1>Hello</h1><p>I love coding.</p></div>`
}

Prettier does not format it whatsoever. Notice how instead of html I am using /*html*/ because I am not using lit-html, but I still want to have syntax highlighting and formatting for html string literals.

How can I get prettier to format it correctly?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant