Open
Description
Before You File a Bug Report Please Confirm You Have Done The Following...
- I have tried restarting my IDE and the issue persists.
- I have updated to the latest version of the packages.
- I have searched for related issues and found none that matched my issue.
- I have read the FAQ and my problem is not listed.
Playground Link
Repro Code
const parser = new DOMParser();
const parsed = parser.parseFromString('some xml', 'text/xml');
const resultNodes = parsed.getElementsByTagName('some_node');
// @typescript-eslint/prefer-for-of complains that below loop should be replaced by for-of
for (let i = 0; i < resultNodes.length; i++) {
// stuff
}
// but that does not even compile because HTMLCollectionOf does not have [Symbol.iterator]
for (const rn of resultNodes) {
// stuff
}
ESLint Config
module.exports = {
parser: "@typescript-eslint/parser",
rules: {
"@typescript-eslint/prefer-for-of": "error"
},
};
tsconfig
Expected Result
The rule suggesting the conversion to for-of loop should not trigger in this case
Actual Result
Rule triggers, suggesting uncompilable conversion
Additional Info
No response