digitalbazaar / eslint-config-digitalbazaar

BSD 3-Clause "New" or "Revised" License
2 stars 1 forks source link

Add eslint as a peerDepency to this project. #9

Closed aljones15 closed 5 years ago

aljones15 commented 5 years ago

just so eslint is there for sure on install.

mattcollier commented 5 years ago

Would any harm come from making eslint a regular dependency? If we did that, then we don't have to track eslint dep in all of our modules. Also, experience tells me that for a variety of reasons, people don't pay much attention to npm errors like missing peer deps.

mattcollier commented 5 years ago

Looking at airbnb, looks like they have eslint listed as both a devDependency and a peer dep? https://github.com/airbnb/javascript/tree/master/packages/eslint-config-airbnb-base

dlongley commented 5 years ago

Seems like we should just make it a devDependency. That's the only time you need it. Not sure how making it a peerDependency helps as it will just generate a warning people won't read. I suppose it locks in a preferred version, but so would using devDependency (plus we'd get the install). Thoughts?

mattcollier commented 5 years ago

@dlongley if eslint is a dev dependency in this module and this module is a dev-dependency of module foo, does eslint get installed?

aljones15 commented 5 years ago

you guys know better than me on this one (I have only worked in deps and devDeps never peer) so I will do whichever one you recommend. also can expand this with test rules that include:

https://github.com/lo1tuma/eslint-plugin-mocha/blob/master/docs/rules/no-mocha-arrows.md

if needed.

dlongley commented 5 years ago

@mattcollier,

if eslint is a dev dependency in this module and this module is a dev-dependency of module foo, does eslint get installed?

Ugh, I guess not. I don't think that making it a peerDependency would do that either.

aljones15 commented 5 years ago

@mattcollier,

if eslint is a dev dependency in this module and this module is a dev-dependency of module foo, does eslint get installed?

Ugh, I guess not. I don't think that making it a peerDependency would do that either.

might be misunderstanding this one: actually that's the point of peerDepencies is that when you install this package it's peerDepencies install at the same time:

https://nodejs.org/en/blog/npm/peer-dependencies/

"UPDATE: npm versions 1 and 2 will automatically install peerDependencies if they are not explicitly depended upon higher in the dependency tree. For all following versions of npm (starting with npm@3), this will no longer be the case. You will receive a warning that the peerDependency is not installed instead."

actually looks like I'm not understadning the naunces of how these different installs work so I am saying we copy airbnb devDep with peerDep.