developit / developit/greenlet

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

Offen
#56 1 Kommentar 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
Vorherrschende Sprache
JavaScript
Sterne
4.7k
Forks
97
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

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?

Beitragsleitfaden

Für dieses Repository ist kein Beitragsleitfaden indexiert

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.