sindresorhus/eslint-plugin-unicorn

prevent-abbreviations renames parameter, but not reference to parameter in type guard signature

Geschlossen

#765 geöffnet am 02.06.2020

 (3 Kommentare) (1 Reaktion) (0 zugewiesene Personen)JavaScript (468 Forks)user submission
bughelp wanted

Repository-Metriken

Stars
 (5.022 Sterne)
PR-Merge-Metriken
 (Durchschn. Merge 1T 16h) (399 gemergte PRs in 30 T)

Beschreibung

Repro:

const isString = (val: unknown): val is string => typeof val === 'string'

gets autofixed to

const isString = (value: unknown): val is string => typeof value === 'string'

which no longer compiles because the signature still mentions val.

Contributor Guide