enhancementhelp wanted
描述
When "autofixing" an array to a set, the type definition should be fixed too (or the fix should be skipped).
prefer-set-has
const a: Array<'foo' | 'bar'> = ['foo', 'bar']
for (let i = 0; i < 3; i++) {
if (a.includes(someString)) {
console.log(123)
}
}
This is corrected to:
const a: Array<'foo' | 'bar'> = new Set(['foo', 'bar'])
for (let i = 0; i < 3; i++) {
if (a.has(someString)) {
console.log(123)
}
}
Which is confusing and wrong.