microsoft / microsoft/TypeScript
Enforce consistent imports when directory is in jsconfig's paths
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 111k
- Forks
- 14.3k
- Avg merge
- 2d 4h
- Merged PRs (30d)
- 132
Description
TS Template added by @mjbvz
TypeScript Version: 3.9.0-dev.20200427
Search Terms
- javascript
- auto import
- symlink
- VSCode Version: 1.43.2
- OS Version: macOS 10.15.3
Steps to Reproduce:
- Specify a
jsconfig.jsonthat includescompilerOptions.pathsto a specific directory - Let intellisense import a variable from this specific directory
- Depending on how deep you are in the code base, it will resolve that variable relatively or absolutely
You can take a look at this reproduction repo: https://github.com/Floriferous/vscode-symlink-import
More specifically the 2 files code.js and deepCode.js, they both resolve the variable differently, as javascript.preferences.importModuleSpecifier is set to auto.
I'd like a folder specified in paths to always resolve as myPathsFolder/...
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 with the reproduction repository and its jsconfig.json, then compare the imports generated in code.js and deepCode.js when javascript.preferences.importModuleSpecifier is set to auto. Verify how paths entries affect the selected module specifier. Done means both files consistently use the configured myPathsFolder/... form.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, typescript
- Domain
- developer-experience
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100