developit / developit/greenlet

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

Ouverte
#56 1 commentaire 0 réactions 0 personnes assignées Voir sur GitHub
Langage dominant
JavaScript
Étoiles
4.7k
Forks
97
Métriques de merge des PR
Aucune PR mergée en 30 j

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?

Guide de contribution

Aucun guide de contribution indexé pour ce dépôt

Piste de recherche

Start with the greenlet() call and the example's closure over myFavNumber, then check whether the project documents or exposes a way to mark such functions as external or scope-less. Done means identifying a supported annotation for ESLint/TypeScript or documenting that no such marker exists.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Évaluation

Stack technique
javascript, typescript
Domaine
tooling
Type d'issue
Fonctionnalité
Difficulté
5/5
Temps estimé
Plus d'une semaine
Activité
Calme
Clarté
À clarifier
Accessibilité débutants
35/100

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.