Skip to content

No intellisense for require in ts files #30531

@hediet

Description

@hediet

TypeScript Version: 3.4.0-rc
Search Terms: require, intellisense

Typescript does not resolve modules of require expressions as it does in plain js files.

Code

require("s:\\dev\\easy-attach\\")({
    eagerExitDebugProxy: true,
    port: "preconfigured",
    
});

Expected behavior:
This is what I get in VS Code in plain js files:
image

Actual behavior:
However, the module is not resolved in ts files:
image

Probably this is intended and my use case is a very special one.
However, typescripts repository description still says:

TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

In this case, typescript has better support for require in js than in ts which is a little bit confusing considering typescript being a superset of javascript.

Metadata

Metadata

Assignees

No one assigned

    Labels

    In DiscussionNot yet reached consensusSuggestionAn idea for TypeScript

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions