import-js/eslint-plugin-import

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

Offen

#1.549 geöffnet am 30.11.2019

 (0 Kommentare) (5 Reaktionen) (0 zugewiesene Personen)JavaScript (1.549 Forks)batch import
bughelp wantedtypescript

Repository-Metriken

Stars
 (5.940 Sterne)
PR-Merge-Metriken
 (Durchschn. Merge 138T 22h) (3 gemergte PRs in 30 T)

Beschreibung

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

Contributor Guide