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

Convert to ESM uses template strings instead of string literals #59304

Closed
huseeiin opened this issue Jul 16, 2024 · 1 comment · Fixed by #59306
Closed

Convert to ESM uses template strings instead of string literals #59304

huseeiin opened this issue Jul 16, 2024 · 1 comment · Fixed by #59306
Labels
Bug A bug in TypeScript Domain: Refactorings e.g. extract to constant or function, rename symbol Effort: Casual Good issue if you're already used to contributing to the codebase. Harder than "good first issue". Help Wanted You can do this
Milestone

Comments

@huseeiin
Copy link

when you convert a require const swc = require(`@swc/core`) to esm with the quickfix, its gonna result in a syntax error because you can't have backticks in import statements

Does this issue occur when all extensions are disabled?: Yes

  • VS Code Version: 1.90.0
  • OS Version: Linux 6.5.0-41-generic x86_64 x86_64
    image

Steps to Reproduce:

  1. const swc = require(`@swc/core`)
  2. apply the "'require' call may be converted to an import." fix
@VSCodeTriageBot
Copy link

Thanks for creating this issue! It looks like you may be using an old version of VS Code, the latest stable release is 1.91.1. Please try upgrading to the latest version and checking whether this issue remains.

Happy Coding!

@mjbvz mjbvz transferred this issue from microsoft/vscode Jul 16, 2024
@mjbvz mjbvz removed their assignment Jul 16, 2024
@DanielRosenwasser DanielRosenwasser added Bug A bug in TypeScript Help Wanted You can do this Domain: Refactorings e.g. extract to constant or function, rename symbol Effort: Casual Good issue if you're already used to contributing to the codebase. Harder than "good first issue". labels Jul 16, 2024
@DanielRosenwasser DanielRosenwasser added this to the Backlog milestone Jul 16, 2024
@DanielRosenwasser DanielRosenwasser changed the title backtick ESM/CJS issue Convert to ESM uses template strings instead of string literals Jul 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug A bug in TypeScript Domain: Refactorings e.g. extract to constant or function, rename symbol Effort: Casual Good issue if you're already used to contributing to the codebase. Harder than "good first issue". Help Wanted You can do this
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants