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/default] False positive when exporting a default value using destructuring #545

Closed
skyrpex opened this issue Sep 7, 2016 · 5 comments
Assignees

Comments

@skyrpex
Copy link

skyrpex commented Sep 7, 2016

Exporting a default value using destructuring seems to cause a false positive. Example:

store.js

// Export a default value
export { mapGetters as default } from 'vuex';
// This is the equivalent that correctly works
// import { mapGetters } from 'vuex';
// export default mapGetters;

// Other exports...
export const USER = 'user';

file.js

import mapGetters, { USER } from './store.js';
// ESLint says: (import/default) No default export found in module.

I'm using transform-export-extensions.

@benmosher
Copy link
Member

Wild. I could have sworn there was a test for this. Will check it out.

@benmosher benmosher added the bug label Sep 7, 2016
@benmosher
Copy link
Member

Ah, yeah, maybe it is the from 'vuex' that's killing it. There is a test for named default export, but not for exporting from. (though I'd expect it to work).

A PR with a failing test would be much appreciated. 🤓

@skyrpex
Copy link
Author

skyrpex commented Sep 13, 2016

I tried but I can't understand the tests structure... I created a test that imports an unexististing file and it did pass anway... 😕

@benmosher
Copy link
Member

Fair enough, thanks for trying.

(and yeah, the default rule does not enforce anything if the module can't be resolved; that responsibility is left to no-unresolved)

@benmosher
Copy link
Member

Ah, yeah, so this is the classic problem where deep checks don't properly respect ignore semantics.

TL;DR: will fix, have a failing test case 😎

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

3 participants