我偶然发现了一个问题,在 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.
最佳答案
将 block 添加到 settings.json
将解决这个问题:
"eslint.workingDirectories": [
{"mode": "auto"}
],
访问 settings.json
文件,点击Ctrl+,
或从文件 > 首选项 > 设置,然后在搜索栏中输入eslint,在Options的settings.json中找到Edit。
关于javascript - "Parsing error: No babel config file detected"IDE在Vue项目根目录下打不开,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/71271760/