SonarQube 8.9.7-community, Docker
Since index is actually being used in string interpolation here, the increment/assignment of index is not useless.
Maybe id should raise a positive as well, since it’s not being used and convention might prefer it being named ‘_’, but I’m not sure if that’s just preference or something that should actually be enforced.
const someIds = [1, 5, 8];
const queryParams = someIds.map((id, index) => {
return `(${++index}::int)`; // Remove this useless assignment to variable "index" javascript:S1854
}).join(',');