You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
(I didn't test this but I assume this is the minimal case)
consta={foo: false};constb={foo: false};constxs=[a,b];for(leti=0;i<2;++i){xs[i].foo=true;}// I assume `xs[0].foo = true` would also trigger this issue even without the loop
Basically, xs is only being used as a list of pointers to items that will get modified.
Expected behavior
no-unused-collection should not fire here as the collection is being used.
We ran into this case of
no-unused-collection
incorrectly firing on a collection which is actually used:https://github.com/themoeway/yomitan/blob/7a8612b035e0847ea0f0e2fc6643693c89bc80f4/ext/js/pages/permissions-main.js#L107-L116
Reproducer
(I didn't test this but I assume this is the minimal case)
Basically,
xs
is only being used as a list of pointers to items that will get modified.Expected behavior
no-unused-collection
should not fire here as the collection is being used.eslint-plugin-sonarjs version: 0.23.0
eslint version: 8.56
Node.js version: 20
Rule key:
no-unused-collection
The text was updated successfully, but these errors were encountered: