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

Improve some error reporting #114

Merged
merged 3 commits into from Jan 8, 2016

Conversation

lencioni
Copy link
Collaborator

@lencioni lencioni commented Jan 8, 2016

No description provided.

I was trying out import-js in a project that has an .eslintrc.js file
that extends an eslint config package installed by npm. When running
auto import in this project, it was simply just not doing anything,
which was perplexing because I could see eslint reporting undefined
variables that import-js could resolve. After some digging, I discovered
that this was because eslint was outputting errors like:

> Cannot read config package: eslint-config-airbnb

This commit doesn't resolve the problem I was encountering, but it at
least makes it easier to understand what is going on.

After knowing this, I was able to resolve my problem by installing the
missing eslint config package globally.
I was trying out import-js in a project that has an .eslintrc.js file
that relies on an eslint plugin installed by npm. When running auto
import in this project, it was simply just not doing anything, which was
perplexing because I could see eslint reporting undefined variables that
import-js could resolve. After some digging, I discovered that this was
because eslint was outputting errors like:

> Cannot find module 'eslint-plugin-react'

This commit doesn't resolve the problem I was encountering, but it at
least makes it easier to understand what is going on.

After knowing this, I was able to resolve my problem by installing the
missing eslint plugin package globally.
I was trying out import-js in a project that has an .eslintrc.js file
that relies on a parser installed by npm. When running auto import in
this project, it was simply just not doing anything, which was
perplexing because I could see eslint reporting undefined variables that
import-js could resolve. After some digging, I discovered that this was
because eslint was outputting errors to stdout like:

> <text>:0:0: Cannot find module 'babel-eslint'

This commit doesn't resolve the problem I was encountering, but it at
least makes it easier to understand what is going on.

After knowing this, I was able to resolve my problem by installing the
missing eslint parser package globally.
@lencioni
Copy link
Collaborator Author

lencioni commented Jan 8, 2016

I'm not sure under what circumstances eslint will output to stderr, but it might not be a bad idea to bubble stderr up to the editor in every case.

lencioni added a commit that referenced this pull request Jan 8, 2016
@lencioni lencioni merged commit 1e520da into Galooshi:master Jan 8, 2016
@lencioni lencioni mentioned this pull request Jan 9, 2016
@lencioni lencioni deleted the cannot-read-config-package branch January 18, 2016 20:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant