Skip to content

Unmet peer dependency #1283

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

Closed
pronebird opened this issue Jan 31, 2017 · 13 comments
Closed

Unmet peer dependency #1283

pronebird opened this issue Jan 31, 2017 · 13 comments

Comments

@pronebird
Copy link

pronebird commented Jan 31, 2017

npm i eslint-config-airbnb --save-dev

├─┬ eslint-config-airbnb@14.0.0
│ ├── eslint-config-airbnb-base@11.0.1
│ └── UNMET PEER DEPENDENCY eslint-plugin-import@^2.2.0
├── UNMET PEER DEPENDENCY eslint-plugin-import@^2.2.0
├── UNMET PEER DEPENDENCY eslint-plugin-jsx-a11y@^3.0.2
└── UNMET PEER DEPENDENCY eslint-plugin-react@^6.9.0

Why is it broken?

pronebird pushed a commit to jschr/electron-react-redux-boilerplate that referenced this issue Jan 31, 2017
pronebird pushed a commit to jschr/electron-react-redux-boilerplate that referenced this issue Jan 31, 2017
* - Add redux-thunk
- Move store configuration into separate file
- Purge unused redux-devtools-* packages

* Enable inline source maps

* Remove unused import

* Drop eslint-config-airbnb due to unmet peer dependencies

See airbnb/javascript#1283

* Update ESLint to use recommended settings and react plugin

* Add mocha: true to suppress undefined describe/it functions

* - Rename store/configureStore to store/default
- Add missing import for redux.compose

* Print extension installation errors

* - Add --no-ignore flag to suppress warnings for ignored files
- Remove --format option

* Add scripts to eslint
@ljharb
Copy link
Collaborator

ljharb commented Jan 31, 2017

Please use the install command in the package readme; this will install the correct peer dependencies.

@just-boris
Copy link

just-boris commented Feb 7, 2017

By the way it worth mentioning, that NPM 3+ will not install peer dependencies for you. You need to explicitly declare them in your package.json

@ljharb why do you keep them as peers? The most common use case for the code-style will be npm install -D eslint-config-airbnb, then write {"extends": "airbnb"}, and you will be set.
Currently, you need to do an extra step and install those dependencies as well. package.json of average project becomes longer and longer.

@ljharb
Copy link
Collaborator

ljharb commented Feb 7, 2017

@just-boris eslint requires that it work that way; if they're not peers, none of the rules will work or be overrideable.

@just-boris
Copy link

Do you mean the issue: eslint/eslint#3458?

Thanks for explanation, now I understand why do I need to do so.

@gazpachu
Copy link

gazpachu commented Mar 3, 2017

@pronebird @just-boris @ljharb I still have problems to have the latest version working.

I get this error message (in Atom) everytime I open a file: /node_modules/eslint-config-airbnb/rules/react-a11y.js: Configuration for rule "jsx-a11y/href-no-hash" is invalid: Value "[object Object]" no (or more than one) schemas match. Referenced from: airbnb Referenced from: /Users/martosj/Dev/Webs/commit-frontend/.eslintrc.js

These are the packages I'm using:

"eslint": "^3.15.0",
"eslint-config-airbnb": "^14.0.0",
"eslint-plugin-import": "^2.2.0",
"eslint-plugin-jsx-a11y": "^3.0.2 || ^4.0.0",
"eslint-plugin-react": "^6.9.0",

This is my .eslintrc.js:

module.exports = {
  "extends": "airbnb",
  "rules": {
    "indent": [2, "tab", { "SwitchCase": 1, "VariableDeclarator": 1 }],
      "react/prop-types": 0,
      "react/jsx-indent": [2, "tab"],
      "react/jsx-indent-props": [2, "tab"],
      "comma-dangle": ["error", "never"]
  },
  "globals": {
    "document": true,
    "window": true
  }
}

@ljharb
Copy link
Collaborator

ljharb commented Mar 3, 2017

Are you sure the versions on disk are correct, and that you've restarted atom? What's npm ls say?

@gazpachu
Copy link

gazpachu commented Mar 3, 2017

Oh dear, yeah, restarting Atom fixed it 👍
On the other hand, I get now 'Unexpected tab character (no-tabs) whereas with the previous version, it was working fine. Any idea?

@pronebird
Copy link
Author

pronebird commented Mar 3, 2017

I think we can close this issue since as it turned out peer deps have to be installed manually. Thanks for all help!

@ljharb
Copy link
Collaborator

ljharb commented Mar 3, 2017

@gazpachu that seems like eslint updated to catch an error it was missing before. I'd just fix your code.

@gazpachu
Copy link

gazpachu commented Mar 3, 2017

@ljharb I'm afraid that's not the case. If I remove the tab, I get this:

screen shot 2017-03-03 at 17 39 18

And if I add the tab, I get this:

screen shot 2017-03-03 at 17 40 12

And that's happening to all lines of all files :/

I've tried to remove the rules section in the eslintrc.js file but nothing changes.

@ljharb
Copy link
Collaborator

ljharb commented Mar 3, 2017

Do you use tabs or spaces for indentation?

@gazpachu
Copy link

gazpachu commented Mar 3, 2017

tabs

@ljharb
Copy link
Collaborator

ljharb commented Mar 3, 2017

In that case, you need to disable the no-tabs rule entirely. Airbnb uses spaces, so the guide comes configured to ban all tab characters.

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

No branches or pull requests

4 participants