import-js / import-js/eslint-plugin-import

"Multiple exports of name 'xxx' import/export" error is thrown if types are exported

Open
#3,136 3 comments 0 reactions 0 assignees View on GitHub
bug help wanted typescript
Dominant language
JavaScript
Stars
5.9k
Forks
1.5k
PR merge metrics
No merged PRs in 30d

Description

We have the following two files in the package:

m.ts
```
export interface Foo {}

export function f(foo: Foo): void {
}
```

index.ts
```
export {f} from 'm';
export type * from 'm';
```

Actual result:

While linting this code the plugin prints the following error for `index.ts`:

`Multiple exports of name 'f' import/export`

Expected result:

I don't expect the error to be thrown for the above case as the second expression in `index.ts` exports types, so there should be no duplicates.

Plugin version: 2.31.0

Contributor guide

Open the contributing guide

Research direction

Reproduce the report using m.ts and index.ts, focusing on the import/export rule and its handling of `export type *`. Check how the rule compares the named exports from those files. Done means the example no longer reports a duplicate `f` export and the behavior is covered by a regression test.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, typescript
Domain
tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.