vscode的 automatic Imports 功能在不同文件夹表现不同

已经禁用了所有插件

我的jsconfig配置:

{
  "compilerOptions": {
    "baseUrl": ".",
    "paths": {
      "@/gulp/*": ["script/gulp/*"],
      "@/script/*": ["script/*"],
      "@/src/*": ["src/*"]
    }
  },
  "exclude": ["node_modules", "dist"]
}

我项目的目录结构

├── script
│   ├── gulp
│   │   ├── task
│   │   │   ├── components
│   │   │   │   └── index.js
│   │   │   └── ...
│   │   └── ...
│   │
│   ├── utils
│   │   ├── yaml.js <-- 这个文件里的automatic import功能表现是我想要的
│   │   └── ...
│   └── ...
│
├── src
│   ├── app.js <-- 我不想要这个文件里的automatic import功能表现
│   └── ...
│
├── jsconfig.json
├── gulpfile.babel.js
└── ...

在script目录下使用automatic import功能(我想要的表现)

script directory

在src目录下使用automatic import功能(我不想要的表现)

src directory

不知道是哪里配置得不对.

有谁能帮忙看下.

阅读 1.4k
1 个回答
撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进