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 CLI gives no information about exceptions thrown on plugin load #6874

Closed
platinumazure opened this issue Aug 9, 2016 · 8 comments · Fixed by singapore/lint-condo#244 or renovatebot/renovate#147 · May be fixed by iamhunter/teammates#4
Assignees
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 bug ESLint is working incorrectly cli Relates to ESLint's command-line interface help wanted The team would welcome a contribution from the community for this issue

Comments

@platinumazure
Copy link
Member

What version of ESLint are you using?
2.13.1 (with eslint-plugin-react 6.0.0)

What parser (default, Babel-ESLint, etc.) are you using?
Default (this shouldn't matter)

Please show your full configuration:

{
    "plugins": ["react"]
}

What did you do? Please include the actual source code causing the issue.

$ eslint --debug someFile.js

What did you expect to happen?
Plugin loads successfully, or if it fails to load, the exception thrown should show up in eslint --debug.

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

eslint:cli Running on files +0ms
eslint:ignored-paths Looking for ignore file in /path/to/root +88ms
eslint:ignored-paths Could not find ignore file in cwd +3ms
eslint:glob-util Creating list of files to process. +0ms
eslint:cli-engine Processing /path/to/js/file +23ms
eslint:cli-engine Linting /path/to/js/file +2ms
eslint:config Constructing config for /path/to/js/file +1ms
eslint:config Using .eslintrc and package.json files +0ms
eslint:config Loading /.eslintrc +3ms
eslint:config-file Loading config file: /.eslintrc +1ms
eslint:plugins Failed to load plugin eslint-plugin-react. Proceeding without it. +212ms

With no indication of why the plugin failed to load. In this case, it wasn't due to the plugin not being available, but rather the require() failed due to something wrong with the plugin's main file.

@eslintbot eslintbot added the triage An ESLint team member will look at this issue soon label Aug 9, 2016
@platinumazure platinumazure added bug ESLint is working incorrectly core Relates to ESLint's core APIs and features accepted There is consensus among the team that this change meets the criteria for inclusion cli Relates to ESLint's command-line interface and removed triage An ESLint team member will look at this issue soon core Relates to ESLint's core APIs and features labels Aug 9, 2016
@platinumazure
Copy link
Member Author

platinumazure commented Aug 9, 2016

In addition, I'm wondering if we want to try to detect if the plugin existed (but threw an exception on require) vs the plugin didn't exist, and modify the pretty message template accordingly.

@pmcelhaney
Copy link
Contributor

Is it only 2.x or does it happen on 3.x as well?

@platinumazure
Copy link
Member Author

@pmcelhaney Good question, I'll try to repro with latest and see what happens.

Unfortunately the issue can be obscured by the fact that a plugin could fix itself (this only happens when a plugin exists locally but throws when it is require'd by ESLint). So I suppose the best thing I could do is to create a temporary repo representing a bad plugin that could be npm link'd to reproduce the issue. I'll see if I can get that done in the next couple of days.

@platinumazure
Copy link
Member Author

I've been pretty busy with some other issues (both code I'm writing and issues I'm trying to shepherd through), so this has unfortunately fallen by the wayside. I'm hoping to confirm on ESLint 3.x this week and set up a fake plugin repo to prove the issue.

If we can keep this open a little while longer, I'd be most grateful. 😄

@platinumazure platinumazure self-assigned this Sep 6, 2016
@platinumazure platinumazure removed their assignment Sep 24, 2016
@platinumazure platinumazure added the tsc agenda This issue will be discussed by ESLint's TSC at the next meeting label Sep 27, 2016
@platinumazure
Copy link
Member Author

TSC Summary: This issue is accepted, but I wanted to see if this merited being included on the core roadmap project.

TSC Question: Should this issue be added to the core roadmap project?

@kaicataldo
Copy link
Member

As per the discussion during today's TSC meeting, this issue has been added to the Core Roadmap.

@kaicataldo kaicataldo removed the tsc agenda This issue will be discussed by ESLint's TSC at the next meeting label Sep 29, 2016
@kaicataldo kaicataldo added the help wanted The team would welcome a contribution from the community for this issue label Dec 23, 2016
@platinumazure
Copy link
Member Author

@kaicataldo has suggested also solving issue #7668 in this one. So the goal would be for the basic UX to change around plugin errors (i.e., user can tell via pretty exception message whether the plugin didn't exist or it threw an exception); and eslint --debug should also give some more information in this same scenario.

@platinumazure platinumazure changed the title ESLint --debug gives no information about exceptions thrown on plugin load ESLint CLI gives no information about exceptions thrown on plugin load Dec 23, 2016
@kaicataldo
Copy link
Member

kaicataldo commented Jan 8, 2017

Here's another one 😆 : #6976

@not-an-aardvark not-an-aardvark self-assigned this Mar 25, 2017
not-an-aardvark added a commit that referenced this issue Mar 25, 2017
Previously, if a plugin threw an error on load, ESLint would display the "missing plugin" error message. This was confusing for plugin developers, because it would be difficult to distinguish between an installation error and a broken plugin.
@not-an-aardvark not-an-aardvark moved this from Ready to Implement to In Progress in Core Roadmap Mar 25, 2017
@alberto alberto moved this from In Progress to Done in Core Roadmap Mar 30, 2017
@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 bug ESLint is working incorrectly cli Relates to ESLint's command-line interface help wanted The team would welcome a contribution from the community for this issue
Projects
No open projects
5 participants