Skip to content

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

@fregante

Description

@fregante

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions