Strange ESLint warning (unbound method...this
scoping) from createTypedSessionStorage
#218
Unanswered
slamflipstrom
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
For some reason ESLint is unhappy with the deconstruction of session helper functions from
createTypedSessionStorage()
. Here's my the error I'm seeing in session.server.ts file:Avoid referencing unbound methods which may cause unintentional scoping of `this`. If your function does not access `this`, you can annotate it with `this: void`, or consider using an arrow function instead.
And here's the offending code:
const { getSession, commitSession, destroySession } = typedSessionStorage;
With the full file for additional context:
Any idea why I'd be getting the ESLint warning?
Beta Was this translation helpful? Give feedback.
All reactions