Главная » Ошибки » “Parsing error: No babel config file detected” when IDE not open at Vue projects root directory

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

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

How to solve “Parsing error: No babel config file detected” when IDE not open at Vue projects root directory

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.

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

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.

Настройка лучшего сценария eslint с git pre-commit?

  • 1 подписчик
  • 13 окт.
  • 54 просмотра

ответов
0

  • javascript
    • JavaScript

    • +1 ещё

    Простой

  • Solution 1

    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.

    Original Author Eslam Gohar Of This Content

    Solution 2

    https://babeljs.io/docs/en/config-files
    Babel expects your config file to be at root level, so in order to un-confuse your IDE you need to create an eslint setting for VSCodes extention. Under vscode-eslint settings switch to workspace on the top tab, then scroll to:

    Eslint: Options

    The eslint options object to provide args normally passed to eslint when executed from a command line (see https://eslint.org/docs/developer-guide/nodejs-api#eslint-class).

    Edit in settings.json <-click on that

    Vs code will make a .vscode/ folder inside which a settings.jsonfile was created. There add this line:

    {
    “eslint.options”: {
    “configFile”: “\ABSOLUTE\PATH\TO\YOUR\PROJECT\VUE_PROJECT\babel.config.js”
    }
    }

    This will tell the IDE what to do.

    Original Author Eslam Gohar Of This Content

    Solution 3

    Two ways fix this issue, It’s worked me 100%.

    I’ve variously attempted to either set requireConfigFile to false or to create some sort of Babel config, in an .eslintrc.js, in a .babelrc (or Babel Configuratio file), and in a “babel” in package.json, all to no effect.

    Method 1 – add this codes into .eslintrc.js

    .eslintrc.js

    “parser”: ‘@babel/eslint-parser’,
    “parserOptions”: {
    “requireConfigFile”: false,
    }

    Method 2 – install this package @babel/core

    npm i –save-dev @babel/core

    .babelrc

    {
    “presets”: [“@babel/preset-env”, “@babel/preset-react”],
    “plugins”: [“@babel/plugin-proposal-optional-chaining”] }

    Original Author Najathi Of This Content

    Почему в stylelintrs.json не подхватывается правило overrides?

    • 1 подписчик
    • вчера
    • 2 просмотра

    ответов
    0

  • node.js
    • Node.js

    • +3 ещё

    Простой

  • Solution 4

    I got this when I amended some of the script settings in package.json. Not precisely sure what mistake I made: I just undid all typing in this file, and things started working again.

    Original Author Adrian Challinor Of This Content

    Источники

    • https://ittutorialpoint.com/parsing-error-no-babel-config-file-detected-when-ide-not-open-at-vue-projects-root-directory/
    • https://qna.habr.com/q/569628
    [свернуть]
    Решите Вашу проблему!


    ×
    Adblock
    detector