Skip to content

False positive: "Multiple default exports" with merged declarations in Typescript #1549

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

Open
bspot opened this issue Nov 30, 2019 · 0 comments

Comments

@bspot
Copy link

bspot commented Nov 30, 2019

In Typescript, a class and an interface with the same name are merged into one type. If I want to export that type as default, I have to export default both the class and the interface.

This is incorrectly flagged with Multiple default exports.

Code:

export default interface Foo {
  a: number
}
export default class Foo {}

Actual:

1:1  error  Multiple default exports  import/export
4:1  error  Multiple default exports  import/export

Expected:
No linting error.

Versions:

  • Typescript 3.7.2
  • eslint-plugin-import 2.18.2
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