developit / developit/greenlet

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

Open
#56 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
4.7k
Forks
97
PR merge metrics
No merged PRs in 30d

Description

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:
```js
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?

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.