greenlet icon indicating copy to clipboard operation
greenlet copied to clipboard

ESLint/TypeScript: Any way to mark the function as external/scope-less?

Open fregante opened this issue 4 years ago • 0 comments

This piece of code passes every static analyzer, ESLint and TS because they don't know that the arrow function is run in a different context:

import greenlet from 'greenlet'

const myFavNumber = 43;

const getFav = greenlet( async () => {
    return myFavNumber
});

Are you aware of any way to mark the function in a way that linters/parsers know myFavNumber is not defined in the function?

fregante avatar Jul 07 '21 16:07 fregante