javascript: ESLint: Failed to load config "airbnb" to extend from.
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:
Already did:
- Deleted node_modules
- run yarn eslint --init
- reloaded vs code
Directory:
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.
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Comments: 17
I had similar issue on a react app
Failed to load config “airbnb” to extend from. Referenced from: /usr/src/.eslintrc and this fixed it!
npm install -g install-peerdeps
install-peerdeps --dev eslint-config-airbnb
@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!For any future reference, acorrding to eslint-config-airbnb, I needed to run
npm info "eslint-config-airbnb@latest" peerDependencies
to view the correct versions of each package thateslint-config-airbnb
needs. I compared that against my already installed packages vianpm ls
. So for me I needed to install one packageeslint-plugin-react-hooks
@jghorton14 the package readme also tells you how to use
npx install-peerdeps
to automate that process.The cause of my problem was, I forgot an “.eslintrc.js” file one directory up from my project folder. So it was using the wrong “.eslintrc.js” file.
@droderuan How are you running eslint? Make sure you have nothing globally installed (which is deprecated), and then use
npx eslint
or annpm run-script
.This worked for me 🎉
Initially installed
npm i eslint eslint-config-airbnb eslint-plugin-import eslint-plugin-jsx-a11y eslint-plugin-react eslint-plugin-react-hooks@^4.3.0 -g
, but was getting the same issue as OP, so I didnpm install -g install-peerdeps
install-peerdeps --dev eslint-config-airbnb
plus the below configuration.Workspace configuration set like this (for Mac):
(I’m using NVM to set my node version, so my pathing will likely look different than yours)
I had this issue with docker. I accidentally added
NODE_ENV=production
(for testing purposes) and forgot it to remove. By removing it everything worked fine 😉I also encountered this problem. The addition of extension is still invalid:
or