microsoft / microsoft/TypeScript
auto import build-in node module with protocol prefix
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 111k
- Forks
- 14.4k
- Avg merge
- 1d 19h
- Merged PRs (30d)
- 117
Description
Currently vscode will auto import build-in node module without node: prefix unless there is already another import with prefix.
Example:
No imports or one or more imports without node: prefix:
One or more import with node: prefix:
I would like to have a setting to force node: prefix.
Related:
https://github.com/eslint-community/eslint-plugin-n/issues/77
https://github.com/import-js/eslint-plugin-import/issues/2717
Workarounds:
- Use eslint rule from
eslint-plugin-unicornplugin: https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-node-protocol.md - Use https://gist.github.com/alex-kinokon/f8f373e1a6bb01aa654d9085f2cff834 with https://www.npmjs.com/package/eslint-plugin-local-rules
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
No source file or test is named in the issue. Start by reproducing the auto-import behavior in VS Code with built-in Node modules, then trace the TypeScript language-service path that chooses the import form. Done means a setting can consistently force the node: prefix without depending on existing imports.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- node.js, typescript, vscode
- Domain
- developer-experience, tooling
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100