我在 VS Code 中遇到了一个问题,当一个 Vue 项目被创建并且没有在 Vue 项目的根目录中打开时,babel.config.js 不会加载并且 IDE 会混淆 babel 配置的位置。
我的所有文件在任何 javascript/vue 文件读取的第一个字符上都显示错误 No Babel config file detected for [#]... or configure babel so that it can find the config files.
原文由 djkato 发布,翻译遵循 CC BY-SA 4.0 许可协议
将块添加到
settings.json
将解决此问题:要访问
settings.json
文件,请单击Ctrl+,
或从文件 > 首选项 > 设置,然后在搜索栏中键入 eslint,在选项 _中的 settings.json 中找到编辑_。