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

Mixed `type` imports does not trigger `import/no-duplicates`

Open
#3,035 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug help wanted typescript
Dominant language
JavaScript
Stars
5.9k
Forks
1.5k
PR merge metrics
No merged PRs in 30d

Description

This correctly triggers `import/no-duplicates`:

```typescript
import { useEffect } from "react";
import { useState } from "react";
```

But this doesn't:

```typescript
import { type ComponentProps, useEffect } from "react";
import { useState } from "react";
```

The rule should merge the imports above into:

```typescript
import { type ComponentProps, useEffect, useState } from "react";
```

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Locate the implementation and tests for the import/no-duplicates rule, then reproduce both TypeScript import examples there. Update the rule so mixed type and value imports from the same module are recognized as duplicates, and add or adjust coverage confirming they merge as shown.

Written by the indexing model from the issue text.

Assessment

Tech stack
eslint, typescript
Domain
tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.