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

no-duplicates: fix false positive

Open steved-stripe opened this issue 9 months ago • 6 comments

fixes https://github.com/un-ts/eslint-plugin-import-x/issues/231

This PR removes the auto fix for:

import {AValue, type x, BValue} from './foo';
import {type y} from './foo'

as our heuristic for type vs non-type imports has changed slightly.

The second import would be considered a type-only import, and the first import would be considered a value import, so we aren't combining them.

We could make this more sophisticated if we wanted to but this fixes the bad autofix that would change:

import {
  type bar,
  buzz,
} from 'foo';
import type {bizz} from 'foo';

into:

import type {
  type bar,
  buzz,
  bizz,
} from 'foo';

related: https://github.com/import-js/eslint-plugin-import/issues/2697

steved-stripe avatar Feb 13 '25 21:02 steved-stripe