sindresorhus/eslint-plugin-unicorn
[consistent-destructuring] incorrect fix for ts `in` type guard
Fechada
#1.112 aberto em 18 de fev. de 2021
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
const { a }: { a: string } & ({ b: number } | { c: number } | {}) = params
const value = 'b' in params ? params.b : 'c' in params ? params.c : null
// incorrect fixed
const { a, b, c }: { a: string } & ({ b: number } | { c: number } | {}) = params
const value = 'b' in params ? b : 'c' in params ? c : null
The fixed codes is not runnable anymore. Playground