Please provide
- Operating system: Ubuntu 22.04.1 LTS
- SonarLint plugin version: v3.14.0
- Programming language you’re coding in: JavaScript
- Is connected mode used: no
And a thorough description of the problem / question:
item.promise = new Promise(async (resolve) => {
while ('bar' in item) {
const bar = item.bar
delete item.bar
await doBar(bar)
}
delete item.promise
resolve()
})
This code yields 'item' is not modified in this loop. sonarlint(javascript:S2189)
even though item
clearly is modified in the loop and bar
is deleted from item
. Is this a false positive? Am I missing something? How can I remove this warning?