import-js/eslint-plugin-import

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

开放

#1,549 创建于 2019年11月30日

 (0 条评论) (5 个反应) (0 位负责人)JavaScript (1,548 个派生)batch import
bughelp wantedtypescript

仓库指标

星标
 (5,940 个星标)
PR 合并指标
 (平均合并 138天 22小时) (30 天内合并 3 个 PR)

描述

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

贡献者指南