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-member #205

Closed
benmosher opened this issue Mar 4, 2016 · 1 comment
Closed

no-named-as-default-member #205

benmosher opened this issue Mar 4, 2016 · 1 comment

Comments

@benmosher
Copy link
Member

Given:

// ./whatever.js
export { someThing }
export default class Whatever { /* ... */ }

Warn on:

import Whatever from './whatever'
Whatever.someThing // Reported: someThing exported as named export alongside Whatever.

Would be unusable/noisy if there are static fields on a default export that match exported fields (i.e. lodash) but that seems fine.

I.e.

import _, { isEmpty } from 'lodash'

would report on _.isEmpty, etc. (assuming lodash exported ES modules). so you could only use the default export for chaining (i.e. _(thing).isEmpty()) which makes sense, otherwise you'd want * as _ anyway.

@dmnd
Copy link
Contributor

dmnd commented Apr 17, 2016

I have an implementation of this rule that I'll clean up and send as a PR either tonight or tomorrow.

dmnd added a commit to dmnd/eslint-plugin-import that referenced this issue Apr 17, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

2 participants