Skip to content

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

@vitorbal

Description

@vitorbal

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.

Metadata

Metadata

Assignees

Labels

acceptedThere is consensus among the team that this change meets the criteria for inclusionarchived due to ageThis issue has been archived; please open a new issue for any further discussionbugESLint is working incorrectlycoreRelates to ESLint's core APIs and features

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions