Open andrmoel opened 1 year ago
Similar issue on my side,
const ripplesResult = el.getElementsByClassName('v-ripple__animation');
if (ripplesResult) {
for (let i = 0; i < ripplesResult.length; i++) {
...
}
}
If I auto fix it, it changes the for loop to:
for (const node: Node of ripplesResult) {
which then has two issues:
Setup:
I use the no-for-loop rule to auto fix my code. My code iterates through a string value. The autofix changes my code wrong and assumes that my string is an object.
Original Code
Code after autofix
The problem is that
entries
is not a valid function on a string. TS2239An interesting observation is, that this appears only when the type definition is given by the function parameter. The autofix works correctly if a const parameter is used. The autofix does not change this code.
Original Code