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

Untagged template literals are incorrectly marked as slow types #453

Open
lucacasonato opened this issue Apr 26, 2024 · 1 comment
Open
Labels
bug Something isn't working

Comments

@lucacasonato
Copy link
Member

lucacasonato commented Apr 26, 2024

// these should be fine
const x = `hello world`;
const x = `hello world` as const;
let x = `hello ${foobar} world`;

// these are not allowed
const x = tpl`hello world`;
const x = `hello ${foobar} world`; // if foobar is a specific string literal type, x will be a merger of these strings.
const x = `hello ${foobar} world` as const;

However right now all are disallowed.

Ref denoland/deno_graph#457 and denoland/deno_graph#458

@lucacasonato lucacasonato added the bug Something isn't working label Apr 26, 2024
@lucacasonato lucacasonato added this to JSR Apr 26, 2024
@github-project-automation github-project-automation bot moved this to Needs Triage in JSR Apr 26, 2024
@lucacasonato lucacasonato moved this from Needs Triage to Ready in JSR Apr 26, 2024
@paambaati
Copy link

For anyone waiting for this fix, I've written a jscodeshift codemod to apply fixes to your code so its ready to publish to JSR – see https://github.com/paambaati/neon-js-sdk/blob/8c1ba1b8b4ad9f3f88f77f0dc783eb69db4e93ed/scripts/transformers/jsr-fixes.ts

Note that this might not work for every piece of code, but it should give you an idea of how to do this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: Ready
Development

No branches or pull requests

2 participants