sindresorhus/eslint-plugin-unicorn

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

Open

#765 opened on Jun 2, 2020

View on GitHub
 (3 comments) (1 reaction) (0 assignees)JavaScript (5,022 stars) (468 forks)user submission
bughelp wanted

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.

Contributor guide

prevent-abbreviations renames parameter, but not reference to parameter in type guard signature · sindresorhus/eslint-plugin-unicorn#765 | Good First Issue