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-config-standard@5.3.1 wants eslint@^2.0.0-rc.0 #6617

Closed
rgant opened this issue Jul 7, 2016 · 27 comments
Closed

eslint-config-standard@5.3.1 wants eslint@^2.0.0-rc.0 #6617

rgant opened this issue Jul 7, 2016 · 27 comments
Labels
accepted There is consensus among the team that this change meets the criteria for inclusion archived due to age This issue has been archived; please open a new issue for any further discussion documentation Relates to ESLint's documentation enhancement This change enhances an existing feature of ESLint

Comments

@rgant
Copy link

rgant commented Jul 7, 2016

Just tried to install eslint for the first time following the readme and I got the following errors with eslint --init choosing the standard config.

What version of ESLint are you using?
3.0.1

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

Please show your full configuration:

{
    "extends": "standard",
    "plugins": [
        "standard"
    ]
}

What did you do? Please include the actual source code causing the issue.
There actually wasn't a 'npm-debug.log' file in directory in spite of what the error message indicated.

What did you expect to happen?
Successful --init

What actually happened? Please include the actual, raw output from ESLint.

$ npm install --save-dev eslint
eslint@3.0.1 node_modules/eslint
├── ignore@3.1.3
├── pluralize@1.2.1
├── path-is-inside@1.0.1
├── imurmurhash@0.1.4
├── estraverse@4.2.0
├── strip-bom@3.0.0
├── strip-json-comments@1.0.4
├── globals@9.9.0
├── esutils@2.0.2
├── progress@1.1.8
├── text-table@0.2.0
├── user-home@2.0.0 (os-homedir@1.0.1)
├── is-resolvable@1.0.0 (tryit@1.0.2)
├── debug@2.2.0 (ms@0.7.1)
├── doctrine@1.2.2 (esutils@1.1.6, isarray@1.0.0)
├── levn@0.3.0 (type-check@0.3.2, prelude-ls@1.1.2)
├── optionator@0.8.1 (fast-levenshtein@1.1.3, type-check@0.3.2, wordwrap@1.0.0, deep-is@0.1.3, prelude-ls@1.1.2)
├── json-stable-stringify@1.0.1 (jsonify@0.0.0)
├── chalk@1.1.3 (escape-string-regexp@1.0.5, supports-color@2.0.0, ansi-styles@2.2.1, has-ansi@2.0.0, strip-ansi@3.0.1)
├── require-uncached@1.0.2 (resolve-from@1.0.1, caller-path@0.1.0)
├── mkdirp@0.5.1 (minimist@0.0.8)
├── shelljs@0.6.0
├── concat-stream@1.5.1 (inherits@2.0.1, typedarray@0.0.6, readable-stream@2.0.6)
├── glob@7.0.5 (path-is-absolute@1.0.0, fs.realpath@1.0.0, inherits@2.0.1, once@1.3.3, inflight@1.0.5, minimatch@3.0.2)
├── espree@3.1.6 (acorn-jsx@3.0.1, acorn@3.2.0)
├── is-my-json-valid@2.13.1 (jsonpointer@2.0.0, generate-function@2.0.0, xtend@4.0.1, generate-object-property@1.2.0)
├── inquirer@0.12.0 (ansi-regex@2.0.0, strip-ansi@3.0.1, ansi-escapes@1.4.0, rx-lite@3.1.2, through@2.3.8, cli-width@2.1.0, figures@1.7.0, string-width@1.0.1, readline2@1.0.1, run-async@0.1.0, cli-cursor@1.0.2)
├── file-entry-cache@1.2.4 (object-assign@4.1.0, flat-cache@1.0.10)
├── js-yaml@3.6.1 (esprima@2.7.2, argparse@1.0.7)
├── table@3.7.8 (slice-ansi@0.0.4, tv4@1.2.7, xregexp@3.1.1, strip-ansi@3.0.1, string-width@1.0.1, bluebird@3.4.1)
├── es6-map@0.1.4 (d@0.1.1, es6-symbol@3.1.0, event-emitter@0.3.4, es6-iterator@2.0.0, es6-set@0.1.4, es5-ext@0.10.12)
├── escope@3.6.0 (esrecurse@4.1.0, es6-weak-map@2.0.1)
└── lodash@4.13.1
$ eslint --init
? How would you like to configure ESLint? Use a popular style guide
? Which style guide do you want to follow? Standard
? What format do you want your config file to be in? JSON
Installing eslint-plugin-standard, eslint-config-standard
npm WARN peerDependencies The peer dependency eslint@^2.0.0-rc.0 included from eslint-config-standard will no
npm WARN peerDependencies longer be automatically installed to fulfill the peerDependency 
npm WARN peerDependencies in npm 3+. Your application will need to depend on it explicitly.
npm WARN peerDependencies The peer dependency eslint-plugin-promise@^1.0.8 included from eslint-config-standard will no
npm WARN peerDependencies longer be automatically installed to fulfill the peerDependency 
npm WARN peerDependencies in npm 3+. Your application will need to depend on it explicitly.
npm ERR! Darwin 15.5.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "i" "--save-dev" "eslint-plugin-standard" "eslint-config-standard"
npm ERR! node v4.2.6
npm ERR! npm  v2.14.12
npm ERR! code EPEERINVALID

npm ERR! peerinvalid The package eslint@3.0.1 does not satisfy its siblings' peerDependencies requirements!
npm ERR! peerinvalid Peer eslint-config-standard@5.3.1 wants eslint@^2.0.0-rc.0

npm ERR! Please include the following file with any support request:
npm ERR!     /Users/rgant/Programming/.../npm-debug.log
Successfully created .eslintrc.json file in /Users/rgant/Programming/...
$ npm --version
2.14.12
@eslintbot eslintbot added the triage An ESLint team member will look at this issue soon label Jul 7, 2016
@platinumazure
Copy link
Member

This is an npm warning due to incompatible peer dependency relationship between eslint-config-standard and eslint. In this case, eslint-config-standard wants ESLint to be between 2.0.0-rc0 (inclusive) and 3.0.0 (exclusive).

This is an eslint-config-standard issue- they need to release a version that has a peer dependency that includes eslint@3.0.1. They may not be ready to do that. If you want to avoid any risk of incompatibility, you may want to use eslint@2.x.

Closing as there's nothing for ESLint to do (but feel free to ask for clarification or to reopen if you believe ESLint has an issue).

@rgant
Copy link
Author

rgant commented Jul 7, 2016

Sorry, I wasn't clear on the divisions between the different projects. I wasn't expecting eslint --init to actually install any npm packages at all. I do feel that if eslint is going to suggest a "popular style guide" it should only list ones that are actually compatible with the current version of eslint.

I will open a ticket with eslint-config-standard.

Thanks

@platinumazure
Copy link
Member

@rgant In that case, the issue seems to be that ESLint wants to install packages at their "latest" version, but that doesn't take into account peer dependencies. I believe we rely on the npm executable for all of this, so the question becomes if npm has a way of determining if a peer dependency relationship is satisfied prior to installing a package or not. If npm supports that, perhaps we could consider an enhancement in this space.

@platinumazure platinumazure added enhancement This change enhances an existing feature of ESLint cli Relates to ESLint's command-line interface evaluating The team will evaluate this issue to decide whether it meets the criteria for inclusion and removed triage An ESLint team member will look at this issue soon labels Jul 7, 2016
@rgant
Copy link
Author

rgant commented Jul 7, 2016

It would be best if there was an automatic solution to detecting compatibility issues, however I believe that the list of "popular style guides" is curated by the developers of this project:

choices: [{name: "Google", value: "google"}, {name: "AirBnB", value: "airbnb"}, {name: "Standard", value: "standard"}],

So all I am suggesting is that if a particular config package cannot be installed in the current version of eslint, then it shouldn't be included in that list.

Alternatively, I think I would be happy as a new user if instead of prompting "Which style guide do you want to follow?" the initializer just informed me how to find these packages on my own. Maybe if it said something like:

There are popular style configuration packages for eslint from Google (eslint-config-google), AirBnB (eslint-config-airbnb), and Standard (eslint-config-standard). You can install one of these packages using npm install --save-dev eslint-config-google for example.

@platinumazure
Copy link
Member

We've definitely had users complain about packages not being installed/available, so that's why we made the change to install packages during eslint --init. Maybe a CLI flag could be discussed to avoid installing packages automatically (e.g., eslint --init --no-install-packages), but that seems like a separate issue.

And yes, we curate the list of available packages, but that doesn't mean we check them to make sure they are peer-compatible with us (especially when we do a major version release). That would not be feasible without an npm-based tool to check at runtime (as discussed above). If it helps, please think of that package list as being maintained on a "best-effort" basis with no guarantee for compatibility or functionality.

@rgant
Copy link
Author

rgant commented Jul 7, 2016

I am just starting out using eslint, but I do appreciate the work you've done. It's already helped me resolve several issues with my application. I honestly don't want to badger you over this. I got what I needed configured and am happily using eslint on my app. I'll stop after this.

There is a --dry-run flag for the npm install command:

$ npm install --dry-run eslint-config-standard
npm WARN peerDependencies The peer dependency eslint@^2.0.0-rc.0 included from eslint-config-standard will no
npm WARN peerDependencies longer be automatically installed to fulfill the peerDependency 
npm WARN peerDependencies in npm 3+. Your application will need to depend on it explicitly.
npm WARN peerDependencies The peer dependency eslint-plugin-promise@^1.0.8 included from eslint-config-standard will no
npm WARN peerDependencies longer be automatically installed to fulfill the peerDependency 
npm WARN peerDependencies in npm 3+. Your application will need to depend on it explicitly.
npm WARN peerDependencies The peer dependency eslint-plugin-standard@^1.3.1 included from eslint-config-standard will no
npm WARN peerDependencies longer be automatically installed to fulfill the peerDependency 
npm WARN peerDependencies in npm 3+. Your application will need to depend on it explicitly.
npm ERR! Darwin 15.5.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "--dry-run" "eslint-config-standard"
npm ERR! node v4.4.7
npm ERR! npm  v2.15.8
npm ERR! code EPEERINVALID

npm ERR! peerinvalid The package eslint@3.0.1 does not satisfy its siblings' peerDependencies requirements!
npm ERR! peerinvalid Peer eslint-config-xo@0.15.2 wants eslint@>=2.12.0
npm ERR! peerinvalid Peer eslint-config-standard@5.3.1 wants eslint@^2.0.0-rc.0

npm ERR! Please include the following file with any support request:
npm ERR!     /Users/rgant/Programming/True-Impact/trueimpact-frontend/npm-debug.log
$ echo $?
1

You could add something like this:

/**
 * Dry run install node modules to check for dependency errors
 * @param   {string|string[]} packages Node module or modules to install
 * @returns {void}
 */
function installDryRun(packages) {
    if (Array.isArray(packages)) {
        packages = packages.join(" ");
    }
    shell.exec("npm i --dry-run " + packages, {stdio: "inherit"});
}

to

function installSyncSaveDev(packages) {

And then add these tests for the list of popular styles to

describe("guide", function() {

@ilyavolodin
Copy link
Member

That might not be a bad idea to add --dry-run first, and at least show clear messaging about why we can't install something.

@ilyavolodin ilyavolodin reopened this Jul 7, 2016
@nzakas
Copy link
Member

nzakas commented Jul 9, 2016

Maybe I'm missing something, but how does doing a dry run help? It seems to output the same error message.

@platinumazure
Copy link
Member

I think the hook is we don't output dry-run and instead parse it for
possible install errors?
On Jul 9, 2016 12:50 PM, "Nicholas C. Zakas" notifications@github.com
wrote:

Maybe I'm missing something, but how does doing a dry run help? It seems
to output the same error message.


You are receiving this because you modified the open/close state.
Reply to this email directly, view it on GitHub
#6617 (comment), or mute
the thread
https://github.com/notifications/unsubscribe/AARWes7zhKv8foArDd9sxTv4xLFt87i0ks5qT99ggaJpZM4JGq7R
.

@ilyavolodin
Copy link
Member

@platinumazure Is correct. Instead of outputting raw npm error message, we can at least say something about `Failed to install style-guide due to version mismatch. Please see our repository for more details", or something like that.

@alberto
Copy link
Member

alberto commented Jul 9, 2016

I think it would be preferable not to list incompatible packages in the first place, even if we have to hand-edit them

@ilyavolodin
Copy link
Member

@alberto Every single time we do major version release all of those packages become incompatible for next few weeks.

@platinumazure
Copy link
Member

Well, there's the whole release candidate thing so that packages have more time to adapt... but I know we had a good reason not to do it this time around (that being pain for the project lead).

@alberto
Copy link
Member

alberto commented Jul 9, 2016

I know, that's why I said we would have to hand edit the list. I think it's a bad experience to show a list to a user and then tell him the style selected is not really available.

@ilyavolodin
Copy link
Member

@alberto We could execute dry-run before displaying the list. And if install fails, we can just not show the that style-guide.

@platinumazure
Copy link
Member

@ilyavolodin @alberto One other possibility might be to see if npm has a Node API we could use, which could allow us to check more granularly in some cases. That doesn't solve the immediate problem, of course, but is it worth investigating?

@nzakas
Copy link
Member

nzakas commented Jul 12, 2016

@platinumazure I think that's overkill for this. Let's remember, people only run this one time at the beginning of their project, so we should solve it in as lightweight a way as possible.

@alberto
Copy link
Member

alberto commented Jul 12, 2016

@ilyavolodin Would you run each one separately? That will probably take a few seconds. At what step would you do it? On init? When they say the want to use a style guide? What if there is none available?

I know disabling and enabling by hand with each major release isn't ideal either, but...

@feross
Copy link
Contributor

feross commented Jul 12, 2016

I just updated eslint-config-standard (and related configs) to support eslint 3. (It's unfortunate that this release coincided with my two week vacation from open source.) This issue can probably be closed now.

@ilyavolodin
Copy link
Member

AirBnB hasn't published their update yet (although they already made the changes). I also don't think eslint-config-google will work either, since XO hasn't been updated, and google relies on XO. So only Standard will work at this point.

@nzakas
Copy link
Member

nzakas commented Jul 13, 2016

Are issues open on each of those repos already?

@nzakas
Copy link
Member

nzakas commented Aug 3, 2016

What's the action item here?

@alberto
Copy link
Member

alberto commented Aug 26, 2016

eslint-config-airbnb and eslint-config-xo are updated to 3.0.

eslint-config-google is not. Relevant issue: google/eslint-config-google#20

Even if it gets updated, this will happen again when we release v4, so we should try to come up with a plan for that.

@nzakas
Copy link
Member

nzakas commented Aug 26, 2016

I think we should encourage shareable configs to specify only a minimum compatible version and not a maximum (like >=2). In general, we try really hard not to break shareable configs and these ones are covered in our regression build.

@nzakas
Copy link
Member

nzakas commented Aug 26, 2016

Looks like the Google config only has a minimum version: https://github.com/google/eslint-config-google/blob/master/package.json#L47

Can anyone confirm if this is still a problem with that config?

@alberto
Copy link
Member

alberto commented Aug 26, 2016

I like that 👍

@alberto
Copy link
Member

alberto commented Aug 26, 2016

@nzakas Sorry, you are right, I didn't notice the Google range syntax. I verified it works with 3.4.0.

@alberto alberto added documentation Relates to ESLint's documentation accepted There is consensus among the team that this change meets the criteria for inclusion and removed cli Relates to ESLint's command-line interface evaluating The team will evaluate this issue to decide whether it meets the criteria for inclusion labels Aug 26, 2016
@eslint-deprecated eslint-deprecated bot locked and limited conversation to collaborators Feb 6, 2018
@eslint-deprecated eslint-deprecated bot added the archived due to age This issue has been archived; please open a new issue for any further discussion label Feb 6, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
accepted There is consensus among the team that this change meets the criteria for inclusion archived due to age This issue has been archived; please open a new issue for any further discussion documentation Relates to ESLint's documentation enhancement This change enhances an existing feature of ESLint
Projects
None yet
Development

No branches or pull requests

7 participants