sindresorhus/eslint-plugin-unicorn

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

Chiusa

#765 aperta il 2 giu 2020

 (3 commenti) (1 reazione) (0 assegnatari)JavaScript (468 fork)user submission
bughelp wanted

Metriche repository

Star
 (5022 stelle)
Metriche merge PR
 (Merge medio 1g 16h) (399 PR mergiate in 30 g)

Descrizione

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.

Guida contributor