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

import/extensions reporting empty extension when target file does not exist #295

Closed
gajus opened this issue May 1, 2016 · 3 comments · Fixed by #296
Closed

import/extensions reporting empty extension when target file does not exist #295

gajus opened this issue May 1, 2016 · 3 comments · Fixed by #296
Labels
Milestone

Comments

@gajus
Copy link
Contributor

gajus commented May 1, 2016

import/extensions Unexpected use of file extension "" for "./../errors/scrape_error"

Subject code:

import ScrapeError from './../errors/scrape_error';

Configuration:

"import/extensions": [
    2,
    "never"
],

Version:

eslint-plugin-import@1.6.1

@lo1tuma
Copy link
Contributor

lo1tuma commented May 2, 2016

Does the file actually have an extension? Does it exist at all? I’ve experienced something similar when trying to import a file that doesn’t exist.

@gajus gajus changed the title import/extensions reporting empty extension import/extensions reporting empty extension when target file does not exist May 2, 2016
@gajus
Copy link
Contributor Author

gajus commented May 2, 2016

You are right. The file does not exist.

In that case, this certainly calls for a better error.

@benmosher benmosher added the bug label May 2, 2016
@benmosher
Copy link
Member

Possibly a dupe of #271. I'm going to look at this right now. Likely resolution will be not reporting anything for extensions if a source path cannot be resolved.

@benmosher benmosher added this to the next milestone May 2, 2016
benmosher added a commit that referenced this issue May 2, 2016
- use source path if unable to resolve (fixes #295, #271)
- don't enforce file extensions on builtins
benmosher added a commit that referenced this issue May 3, 2016
- use source path if unable to resolve (fixes #295, #271)
- don't enforce file extensions on builtins

changelog + docs updates for #296
benmosher added a commit that referenced this issue May 5, 2016
* formatting

* extensions fixes:
- use source path if unable to resolve (fixes #295, #271)
- don't enforce file extensions on builtins

changelog + docs updates for #296

* increase test timeout for Travis?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

Successfully merging a pull request may close this issue.

3 participants