sindresorhus/eslint-plugin-unicorn

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

Fechada

#765 aberto em 2 de jun. de 2020

 (3 comentários) (1 reação) (0 responsável)JavaScript (468 forks)user submission
bughelp wanted

Métricas do repositório

Stars
 (5.022 estrelas)
Métricas de merge de PR
 (Mesclagem média 1d 16h) (399 fundiu PRs em 30d)

Description

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.

Guia do colaborador