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

no-named-as-default #23

Closed
benmosher opened this issue Apr 14, 2015 · 0 comments
Closed

no-named-as-default #23

benmosher opened this issue Apr 14, 2015 · 0 comments

Comments

@benmosher
Copy link
Member

Need a better name.

Given:

// foo.js
export default 'foo';
export const bar = 'baz';

...this would be valid:

import foo from './foo.js';

...and this would be reported:

import bar from './foo.js';

Message something like Using exported name 'bar' as identifier for default export.

Rationale: using an exported name as the name of the default export is either

  • misleading: others familiar with foo.js probably expect the name to be foo
  • a mistake: only needed to import bar and forgot the brackets (the case that is prompting this)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

1 participant