Sec-ant / prettier-plugin-embed

A configurable Prettier plugin to format embedded languages in JS/TS Files.

Home Page:https://www.npmjs.com/package/prettier-plugin-embed/v/latest

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

literal tags with type annotations, sql<Revenue>`...`

robreiss opened this issue · comments

Does prettier-plugin-embed work with generic type annotations on literal tags?

The following snippet doesn't seem to work if I have the <Revenue> annotation after the "sql" tag. If I remove the <Revenue> annotation or use /* sql */ inline it does work.

Doesn't seem to work:

    const data = await sql<Revenue>`
      SELECT
        *
      FROM
        revenue
    `;

This does work.

    const data = await sql<Revenue>/* sql */ `
      SELECT
        *
      FROM
        revenue
    `;

Thanks for the great tool!

Oops, I am not sure what happened. It does seem to work now.

Not sure if this applies to your use case, but sometimes you'll have to reload the vscode window for them to take effect if there're changes in your Prettier config (supposing you're using the vscode Prettier extension).

If you encounter the problem again with reproducible steps, feel free to file an issue.