microsoft / microsoft/TypeScript
Respect Node's `--loader` for VS Code Intellisense
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 111k
- Forks
- 14.3k
- Avg merge
- 1d 19h
- Merged PRs (30d)
- 117
Description
I would like VS Code to be able to use a custom Node.js loader for Intellisense.
For example, if I remove the .mjs extension from my code, I can no longer see the Intellisense for mime-types.mjs.
But my custom loader does not require the extension.
Here is what I am hoping to see: (without the .mjs extension on the import)
I can see the .html reference in the Intellisense drop down.
But here is what I actually see:
I think that now Node.js loaders are going through the normalization process - heading out of experimental, it is a good time for VS Code to start working on respecting loaders.
Perhaps this could live in .vscode/settings.json:
// .vscode/settings.json
{
"loader": "./loader.mjs"
}
It would be important to provide different loaders for different directories for more complex projects/monorepos, etc:
// .vscode/settings.json
{
"loader": {
"./app-one": "./loaders/my-custom-loader-1.mjs",
"./app-two": "./loaders/my-custom-loader-2.mjs",
"./app-three": "react-loader" // <-- Uses a package as a loader
}
}
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 reviewing the proposed .vscode/settings.json loader configuration and the Node.js --loader behavior described in the issue. Determine how Intellisense currently resolves extensionless imports, then define completion criteria for using one loader or different loaders per directory, including package-based loaders.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, node.js, vscode
- Domain
- developer-experience, tooling
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100