eslint-plugin-import icon indicating copy to clipboard operation
eslint-plugin-import copied to clipboard

[Fix] `no-duplicates`: Removing duplicates breaks in TypeScript

Open yesl-kim opened this issue 1 year ago • 1 comments

This PR addresses the issue where multiple import type statements from the same module are not properly combined when the prefer-inline option is enabled. Specifically, the problem arises when importing types with separate import type statements, which should be consolidated into a single import statement with inline type specifiers.

Fixes #3016, fixes #2792.

Given the following code:

import type { x } from 'foo';
import { type y } from 'foo';

as-is:

import type { x, type y } from 'foo';

to-be:

import { type x, type y } from 'foo';

yesl-kim avatar Aug 11 '24 09:08 yesl-kim

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 95.91%. Comparing base (09476d7) to head (eb8882d).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3033      +/-   ##
==========================================
- Coverage   96.02%   95.91%   -0.12%     
==========================================
  Files          78       78              
  Lines        3299     3305       +6     
  Branches     1160     1162       +2     
==========================================
+ Hits         3168     3170       +2     
- Misses        131      135       +4     

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

codecov[bot] avatar Aug 11 '24 09:08 codecov[bot]