Skip to content

quickfix: convert to es6 should add extension #45490

@jimmywarting

Description

@jimmywarting

TS Template added by @mjbvz

TypeScript Version: 4.3.5

Search Terms

  • code action
  • suggestion

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

  • VS Code Version: 1.59.0
  • OS Version: Mac 10.15.7

Steps to Reproduce:

  1. Take any commonjs project (not written in typescript)
  2. Do the quick fix of converting any javascript project into a ES6

Then the extension is omitted. I think it should automatically be added. Cuz ESM is strict about file paths.


  • old code: var dateFormat = require("../lib/dateformat");
  • after conversion: import dateFormat from "../lib/dateformat"; (file not found)
  • expected import dateFormat from "../lib/dateformat.js";

Metadata

Metadata

Assignees

No one assigned

    Labels

    Awaiting More FeedbackThis means we'd like to hear from more people who would be helped by this featureSuggestionAn idea for TypeScript

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions