Javascript: ESLint: Failed to load config "airbnb" to extend from.

Created on 28 May 2020  路  4Comments  路  Source: airbnb/javascript

expect: Eslint add single quote and add white spaces

import React from 'react';

import {Switch} from "react-router-dom";

import Route from "./Route";

error: ESLint: Failed to load config "airbnb" to extend from. Referenced from:
image

Already did:

  • Deleted node_modules
  • run yarn eslint --init
  • reloaded vs code

Directory:
image

ESLint output channel

[Error - 1:12:45 PM] ESLint stack trace:
[Error - 1:12:45 PM] Error: Failed to load config "airbnb" to extend from.
Referenced from: /home/ruan/Documents/Projects/hackingHelp/.eslintrc.js
    at configMissingError (/home/ruan/Documents/Projects/hackingHelp/FRONT-END-Hacking.rio/node_modules/eslint/lib/cli-engine/config-array-factory.js:265:9)
    at ConfigArrayFactory._loadExtendedShareableConfig (/home/ruan/Documents/Projects/hackingHelp/FRONT-END-Hacking.rio/node_modules/eslint/lib/cli-engine/config-array-factory.js:826:23)
    at ConfigArrayFactory._loadExtends (/home/ruan/Documents/Projects/hackingHelp/FRONT-END-Hacking.rio/node_modules/eslint/lib/cli-engine/config-array-factory.js:731:25)
    at ConfigArrayFactory._normalizeObjectConfigDataBody (/home/ruan/Documents/Projects/hackingHelp/FRONT-END-Hacking.rio/node_modules/eslint/lib/cli-engine/config-array-factory.js:660:25)
    at _normalizeObjectConfigDataBody.next (<anonymous>)
    at ConfigArrayFactory._normalizeObjectConfigData (/home/ruan/Documents/Projects/hackingHelp/FRONT-END-Hacking.rio/node_modules/eslint/lib/cli-engine/config-array-factory.js:596:20)
    at _normalizeObjectConfigData.next (<anonymous>)
    at createConfigArray (/home/ruan/Documents/Projects/hackingHelp/FRONT-END-Hacking.rio/node_modules/eslint/lib/cli-engine/config-array-factory.js:340:25)
    at ConfigArrayFactory.loadInDirectory (/home/ruan/Documents/Projects/hackingHelp/FRONT-END-Hacking.rio/node_modules/eslint/lib/cli-engine/config-array-factory.js:433:16)
    at CascadingConfigArrayFactory._loadConfigInAncestors (/home/ruan/Documents/Projects/hackingHelp/FRONT-END-Hacking.rio/node_modules/eslint/lib/cli-engine/cascading-config-array-factory.js:328:46)

ESLint is working, if I delete last line in file, it add again. When I'd setup in the early of project, was working fine. Stop working after a git pull, eslint config file was in .gitignore.

It already happened to me one time and I was not able to resolve. I'm new with it and sorry if it is a simple question.

question

Most helpful comment

@ljharb after npm ls it shows a list of missing packages required by eslint-config-airbnb. Now I was able to solve the problem by installing them, thanks a lot!

All 4 comments

@droderuan How are you running eslint? Make sure you have nothing globally installed (which is deprecated), and then use npx eslint or an npm run-script.

@ljharb I'm adding eslint first, like development dependency, after I run yarn eslint --init, I choose the options and when ask to downgrade, I put yes and install everything. Until then, works fine but in the repository I was working, master doesn't have .eslintrc because of .gitignore. After a merge and push, eslintrc was deleted. I removed .eslintrc from .gitignore, installed again in my branch, and master had eslint again. Everything works fine until I did a git push.
Again, I thought it was because of my mistake in master repo. I deleted node_modules, .eslintrc, removed from package.json, make from the start and still not working. I don't know why it is happening even I make installation from start.

(I'm going to close this, since it's not directly related to this config)

Since you're using yarn instead of npm, i'm not sure what debugging steps to suggest; you'll need to make sure you're using eslint 6, not 7, and that all required peer deps are installed and the versions match. npm ls usually tells you this.

@ljharb after npm ls it shows a list of missing packages required by eslint-config-airbnb. Now I was able to solve the problem by installing them, thanks a lot!

Was this page helpful?
1 / 5 - 1 ratings

Related issues

golopot picture golopot  路  3Comments

tunnckoCore picture tunnckoCore  路  3Comments

tpiros picture tpiros  路  3Comments

ar
mbifulco picture mbifulco  路  3Comments

progre picture progre  路  3Comments