import-js/eslint-plugin-import

[import/no-duplicates] Extra comma added when fixer is run

Open

#2.757 geöffnet am 9. Apr. 2023

Auf GitHub ansehen
 (0 Kommentare) (2 Reaktionen) (0 zugewiesene Personen)JavaScript (1.540 Forks)batch import
bughelp wanted

Repository-Metriken

Stars
 (4.946 Stars)
PR-Merge-Metriken
 (Durchschn. Merge 138T 22h) (3 gemergte PRs in 30 T)

Beschreibung

Input:

import { Foo } from "someImport";
import {
  BarLongNameToEnsureLineBreak,
  BazManLongNameToEnsureLineBreak,
} from "someImport";
import { Qux } from "someImport";

const foo: Foo = "foo";
const bar: BarLongNameToEnsureLineBreak = "bar";
const baz: BazManLongNameToEnsureLineBreak = "baz";
const qux: Qux = "qux";

output:

import { Foo ,
  BarLongNameToEnsureLineBreak,
  BazManLongNameToEnsureLineBreak,
, Qux } from "someImport";

const foo: Foo = "foo";
const bar: BarLongNameToEnsureLineBreak = "bar";
const baz: BazManLongNameToEnsureLineBreak = "baz";
const qux: Qux = "qux";

Note the commas at the end of line 3 and start of line 4.

Possibly related to #2601, tho in that case it appears that the opposite problem is occurring: no comma when there should be

Contributor Guide