Here's the code snippet in question:
const reducer = (element:number, index: number) => [element]; //eslint-message.
const positionsArray = $.map(this.positions, reducer);
I am converting a Float32Array (this.positions) to a JavaScript array. The issue I encounter is: 'index' is defined but never used.eslint@typescript-eslint/no-unused-vars
I am hesitant about using "// eslint-disable-line no-unused-vars" as a solution.
Is there a way to resolve this error for cases where the index is not needed? I tried using reduce and accessing the accumulator without success. Thank you.
EDIT: If I remove the definition of index, I encounter this error: https://i.sstatic.net/pijDm.png