#Unsafe argument of type `any` assigned to a parameter of type `[key: string, value: string, cookie?:

12 messages · Page 1 of 1 (latest)

vivid sapphire
#

I'm not really understanding how to fix this typescript error. The code does not produce a typescript error in another application, so I am assuming it has to do with my tsconfig.json settings? Either way, not sure how to fix this error, the code works fine.

daring kayak
#

that's an error from eslint, not typescript. look more closely at the end of it

vivid sapphire
#

ah you're right. any idea how to resolve it?

daring kayak
#

every eslint rule has a page like that

#

if you don't think it's an error worth worrying about, adjust your linter configs and/or disable the rule locally with a comment

#

in general it's good practice to avoid any though. any is basically turning off the type checker

frigid spindle
#

what I'm wondering is where the any crept in. maybe try hovering each name in your import list to see if any imports failed? TS will turn any unresolved import into an any

daring kayak
#

i think his tooltip is hiding some of the parameters. i might just be value: any or options: any

frigid spindle
#

I'd think so but the same error is on remove (at least I assume it's the same error)

daring kayak
#

(i noticed that too and made a ninja edit 🥷)

frigid spindle
#

but yeah if the code works elsewhere it could be something as simple as forgetting to run npm i in a new checkout