javascriptvue.jsbabeljseslint

"Parsing error: No babel config file detected" when IDE not open at Vue projects root directory


I stumbled into a problem where in VS Code, when a Vue project is created and not open at root directory of the Vue project, babel.config.js wouldn't load and IDE would be confused as to where the babel config is. error when running vue project not at root

All of my files show an error on the first character of any javascript/vue file reading No Babel config file detected for [#]... or configure babel so that it can find the config files.


Solution

  • Adding the block to settings.json will solve this issue:

    "eslint.workingDirectories": [
            {"mode": "auto"}
     ],
    

    To access settings.json file, click Ctrl+, or from, File > Preferences > Settings, then type eslint in the search bar, find Edit in settings.json in Options.