Alert: The variable 'myparam' has been declared but never utilized. no-unused-vars
I have encountered the above warning in my file which includes a Zustand store implementation. However, I believe that this warning is not directly related to Zustand but rather due to the ESLint rules being enforced:
import { create } from 'zustand';
export type MyStoreState = {
myVar: string[];
myFunction: (
myparam: string[],
) => void;
}
const useMyStore = create<MyStoreState>((set) => ({
myVar: [],
myFunction: (myparam) => {
set({
myVar: myparam,
});
}
}));
export default useMyStore;
Below is an excerpt from my .eslintrc.js file:
module.exports = {
// Various ESLint configuration settings and rules defined here...
};
I am seeking assistance in understanding why I am receiving the "no-unused-vars" warning when I am clearly using 'myparam' within the function:
myFunction: (myparam) => {
set({
myVar: myparam,
});
}
The warning for "no-unused-vars" pertains specifically to 'myparam' within the MyStoreType declaration.
I have attempted to disable the "no-unused-vars" rule in the .eslintrc file, however, that does not seem to resolve the issue.