Skip to content

no-named-as-default-member false positive, with default export with 'default' property #507

Closed
@jquense

Description

The following produces the incorrect error;

//bar.js
export default { 
  default: 'baz'
};
//foo.js
import bar from './bar';

const qux = bar.default;

It's incorrectly noting that there is a named export named "default", following the suggestion would lead to this: import bar, { default } from './bar which is clearly not right, and I'd suggest not ever what you want to do in this situation. Perhaps that if the property is from the default export, special case allowing 'default' as a property of that export?

edit: actually that would hold true for any named export, with a property of the same name as the export on it.

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions