import-js/eslint-plugin-import

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

Aperta

#1549 aperta il 30 nov 2019

 (0 commenti) (5 reazioni) (0 assegnatari)JavaScript (1549 fork)batch import
bughelp wantedtypescript

Metriche repository

Star
 (5939 stelle)
Metriche merge PR
 (Merge medio 138g 22h) (3 PR mergiate in 30 g)

Descrizione

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

Guida contributor