import-js / import-js/eslint-plugin-import
[no-duplicates] incorrect report on two non-combinable ts type import statements
- Dominant language
- JavaScript
- Stars
- 5.9k
- Forks
- 1.5k
- PR merge metrics
- No merged PRs in 30d
Description
```ts
import type ESLint from 'eslint'
import type { Linter, SourceCode } from 'eslint'
```
If I merge them into one statement:
```ts
import type ESLint, { Linter, SourceCode } from 'eslint'
```
TS will fail to compile
```log
packages/eslint-plugin-mdx/src/processors/options.ts:5:8 - error TS1363: A type-only import can specify a default import or named bindings, but not both.
5 import type ESLint, { Linter, SourceCode } from 'eslint'
```
Contributor guide
Research direction
Start with the reproduction in packages/eslint-plugin-mdx/src/processors/options.ts and inspect the no-duplicates rule's handling of separate type-only imports. Run the reported TypeScript example through the relevant lint setup, then verify that the valid non-combinable imports no longer produce an incorrect duplicate report.
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
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100