''key' is declared but its value is never read when set google chrome extension v3 local storage value

I define a function with typescript like this:

setLocalStorage: async (key: string, value: string): Promise<string> => {
    return new Promise((resolve, reject) => {
      chrome.storage.local.set({
        key: value
      }, function () {
        resolve("");
      });
    });
  },

but the Visual Studio Code shows error:

'key' is declared but its value is never read.ts(6133)

the key was obviously used in the chrome storage set function, why did this happen? what should I do to fix it?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source