microsoft / microsoft/TypeScript
No intellisense for require in ts files
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 111k
- Forks
- 14.3k
- Avg merge
- 2d 4h
- Merged PRs (30d)
- 132
Description
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:

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

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.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the provided require example in a TypeScript file and compare its IntelliSense with the same expression in a JavaScript file. Investigate the TypeScript language-service path that resolves require expressions; done means the module and its callable options are resolved in TypeScript as expected, or the intended limitation is documented.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, typescript
- Domain
- developer-experience, devtools
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100