Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ESLint: Failed to load config "airbnb" to extend from. #2233

Closed
droderuan opened this issue May 28, 2020 · 4 comments
Closed

ESLint: Failed to load config "airbnb" to extend from. #2233

droderuan opened this issue May 28, 2020 · 4 comments
Labels

Comments

@droderuan
Copy link

@droderuan droderuan commented May 28, 2020

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.

@droderuan droderuan changed the title ESLint: Failed to load config "airbnb" to extend from. Referenced from: /home/ruan/Documents/Projects/hackingHelp/.eslintrc.js. Please see the 'ESLint' output channel for details. ESLint: Failed to load config "airbnb" to extend from. May 28, 2020
@ljharb
Copy link
Collaborator

@ljharb ljharb commented May 29, 2020

@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 ljharb added the question label May 29, 2020
@droderuan
Copy link
Author

@droderuan droderuan commented May 29, 2020

@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.

@ljharb
Copy link
Collaborator

@ljharb ljharb commented May 29, 2020

(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 ljharb closed this May 29, 2020
@droderuan
Copy link
Author

@droderuan droderuan commented May 29, 2020

@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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.