Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VSCode doesn't support leading slash imports #72093

Closed
matthew-dean opened this issue Apr 10, 2019 · 5 comments
Closed

VSCode doesn't support leading slash imports #72093

matthew-dean opened this issue Apr 10, 2019 · 5 comments
Assignees
Labels
info-needed Issue requires more information from poster

Comments

@matthew-dean
Copy link

matthew-dean commented Apr 10, 2019

Issue Type: Bug

This commit added support for leading-slash module resolution.
microsoft/TypeScript#27980

However, even though TypeScript / tsc will handle it fine, VSCode will mark leading slash imports with the error "cannot find module". In addition, typing a / slash will show Intellisense / autocomplete for the system root instead of the tsconfig mapped root.

VS Code version: Code 1.32.3 (a3db5be, 2019-03-14T22:46:48.547Z)
OS version: Darwin x64 17.7.0

System Info
Item Value
CPUs Intel(R) Core(TM) i7-8850H CPU @ 2.60GHz (12 x 2600)
GPU Status 2d_canvas: enabled
checker_imaging: disabled_off
flash_3d: enabled
flash_stage3d: enabled
flash_stage3d_baseline: enabled
gpu_compositing: enabled
multiple_raster_threads: enabled_on
native_gpu_memory_buffers: enabled
rasterization: enabled
surface_synchronization: enabled_on
video_decode: enabled
webgl: enabled
webgl2: enabled
Load (avg) 2, 2, 2
Memory (System) 16.00GB (1.99GB free)
Process Argv
Screen Reader no
VM 0%
Extensions (16)
Extension Author (truncated) Version
npm-intellisense chr 1.3.0
bracket-pair-colorizer Coe 1.0.61
vscode-eslint dba 1.8.2
gitlens eam 9.5.1
vsc-material-theme Equ 2.8.2
vscode-sort hen 0.2.5
JSDocTagComplete Hoo 0.0.2
nearley kar 1.0.3
vscode-lebab mrm 2.6.0
cpptools ms- 0.22.1
vetur oct 0.18.0
material-icon-theme PKi 3.7.0
final-newline sam 0.3.2
code-settings-sync Sha 3.2.7
trailing-spaces sha 0.2.11
cmake-tools vec 1.1.3

(2 theme extensions excluded)

@mjbvz mjbvz self-assigned this Apr 10, 2019
@mjbvz
Copy link
Collaborator

mjbvz commented Apr 10, 2019

Please share your tsconfig

@matthew-dean
Copy link
Author

@mjbvz

  "compilerOptions": {
    "baseUrl": "app",
    "jsx": "react",
    "esModuleInterop": true,
    "paths": {
      "config/*": ["../build/config/*"],
      "~/*": ["react/*"],
      "/*": ["../*"]
    },

@mjbvz
Copy link
Collaborator

mjbvz commented Apr 10, 2019

In the effected file, run the TypeScript: go to project configuration command. Does this open the correct tsconfig?

@mjbvz mjbvz added the info-needed Issue requires more information from poster label Apr 11, 2019
@mjbvz
Copy link
Collaborator

mjbvz commented Apr 22, 2019

Closing as needs more info

@mjbvz mjbvz closed this as completed Apr 22, 2019
@matthew-dean
Copy link
Author

@mjbvz Good call! The tests folders were excluded from TS builds (in tsconfig.json), so apparently that excludes them from VSCode linting (?), which I didn't realize.

@vscodebot vscodebot bot locked and limited conversation to collaborators Jun 11, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
info-needed Issue requires more information from poster
Projects
None yet
Development

No branches or pull requests

2 participants