import-js / import-js/eslint-plugin-import
Mixed `type` imports does not trigger `import/no-duplicates`
Nobody has claimed this yet.
- 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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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