question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

`eslint --init` with airbnb config doesn't install all necessary peerDependencies

See original GitHub issue

What version of ESLint are you using? 3.2.2

What parser (default, Babel-ESLint, etc.) are you using? default

Please show your full configuration: Was automatically generated by eslint --init command (See raw output in the end):

module.exports = {
    "extends": "airbnb",
    "plugins": [
        "react"
    ]
};

What did you do? Please include the actual source code causing the issue. I called eslint --init from the command line. See raw output in the end

What did you expect to happen? I expected eslint --init to install everything needed for the AirBnB style guide after I selected that I wanted to follow that style guide.

What actually happened? Please include the actual, raw output from ESLint. Two dependencies were missing for eslint-config-airbnb to run properly, eslint-plugin-import and eslint-plugin-jsx-a11y. Full output starting from a fresh eslint --init call:

~/Workspace/test_eslint_init$ node_modules/.bin/eslint --init
? How would you like to configure ESLint? Use a popular style guide
? Which style guide do you want to follow? AirBnB
? What format do you want your config file to be in? JavaScript
Installing eslint-plugin-react, eslint-config-airbnb
test_eslint_init@1.0.0 /Users/vitorbalocco/Workspace/test_eslint_init
├─┬ eslint-config-airbnb@10.0.0
│ ├── eslint-config-airbnb-base@5.0.1
│ └── UNMET PEER DEPENDENCY eslint-plugin-import@^1.12.0
├── UNMET PEER DEPENDENCY eslint-plugin-import@^1.12.0
├── UNMET PEER DEPENDENCY eslint-plugin-jsx-a11y@^2.0.1
└─┬ eslint-plugin-react@6.0.0
  └── jsx-ast-utils@1.3.1

npm WARN eslint-config-airbnb@10.0.0 requires a peer of eslint-plugin-jsx-a11y@^2.0.1 but none was installed.
npm WARN eslint-config-airbnb@10.0.0 requires a peer of eslint-plugin-import@^1.12.0 but none was installed.
npm WARN eslint-config-airbnb-base@5.0.1 requires a peer of eslint-plugin-import@^1.12.0 but none was installed.
npm WARN test_eslint_init@1.0.0 No description
npm WARN test_eslint_init@1.0.0 No repository field.
Successfully created .eslintrc.js file in /Users/vitorbalocco/Workspace/test_eslint_init
~/Workspace/test_eslint_init$
~/Workspace/test_eslint_init$ touch test.js
~/Workspace/test_eslint_init$ node_modules/.bin/eslint test.js

Oops! Something went wrong! :(

ESLint couldn't find the plugin "eslint-plugin-jsx-a11y". This can happen for a couple different reasons:

1. If ESLint is installed globally, then make sure eslint-plugin-jsx-a11y is also installed globally. A globally-installed ESLint cannot find a locally-installed plugin.

2. If ESLint is installed locally, then it's likely that the plugin isn't installed correctly. Try reinstalling by running the following:

    npm i eslint-plugin-jsx-a11y@latest --save-dev

If you still can't figure out the problem, please stop by https://gitter.im/eslint/eslint to chat with the team.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

2reactions
ilyavolodincommented, Aug 4, 2016

I don’t really think that extracting it to JSON file is going to help any. It’s already trivial to add dependencies to the init command, since it just requires adding additional string to an array. (see https://github.com/eslint/eslint/pull/6657/files#diff-da527c6839c0e6e4d343b5c77fcdd27cR281)

1reaction
platinumazurecommented, Aug 4, 2016

Looking ahead a bit, I wonder if we could extract some of that information to a configurable JSON file to make maintenance a bit easier?

I’m not advocating doing that for this issue-- just thinking it might be a worthwhile refactor later on.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Quick Set up Eslint with Airbnb Style Guide. - Medium
This style guide has some peer dependencies that must be installed along with it.
Read more >
eslint-config-airbnb - npm
If using npm < 5, Windows users can either install all the peer dependencies manually, or use the install-peerdeps cli tool.
Read more >
Error installing dependencies with ESLint, the STDIN does not ...
Solved installing npm install inquirer@6.3 --save-dev first, this is a issue in: https://github.com/eslint/eslint/issues/11862.
Read more >
eslint-config-airbnb | Yarn - Package Manager
Otherwise, run npm info "eslint-config-airbnb@latest" peerDependencies to list the peer dependencies and versions, then run yarn add --dev <dependency>@<version> ...
Read more >
Set up ESLint and Prettier for React Native projects - Three29
npm uninstall eslint # install the latest eslint package version npm ... enter: Checking peerDependencies of eslint-config-airbnb@latest The config that you ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found