Skip to content

[Suggestion] No suggestions in workspace which ask programmers to convert a CommonJS module into an ES6 module #23391

@mjbvz

Description

@mjbvz

From @momocow on April 9, 2018 3:23

As in #47299, it is obvious to say that many people got annoyed by those ... under our lovely require expression.

I suggest VSC to ask programmers which import style is more preferable based on project by popups (or any fashion that does not persist in workspace).

I have to say that I'm not a conservative who dislikes changing and learning new things. I do love ES6 style but not in NodeJS modules.

Here's my reason.
ES6 modules break some already-existing features of NodeJS, i.e. optional dependencies Once you import a dependency module in an ES6 fashion, you should also install it to make it work. Thus there will be no optional dependencies in ES6 modules. (ES6 modules cannot perform conditional imports)

It is always welcome for someone to correct me if I do mistake something and I must say that I love coding with VSC.
Happy coding everyone 😄

Copied from original issue: microsoft/vscode#47458

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugA bug in TypeScriptFixedA PR has been merged for this issue

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions