Skip to content

Node.js callback verify rule #9971

@BridgeAR

Description

@BridgeAR

In Node.js we would like to add a rule that allows to verify that callbacks are properly in place. This would massively help to prevent using async APIs that do not add a callback.

The fs module is such a case where it is planned to throw in case no callback is provided. Users would get a much better experience if they could get notified with a eslint rule.

For fs that is possible by checking if the used function contains sync in it's name or not and if not, if the last argument is a callback or not. Other than that I would not know how to check this. There will be multiple cases that the rule could not catch but it is probably still helpful.

See also nodejs/node#18668.

Do you think that is feasible?

Metadata

Metadata

Assignees

No one assigned

    Labels

    archived due to ageThis issue has been archived; please open a new issue for any further discussionevaluatingThe team will evaluate this issue to decide whether it meets the criteria for inclusionfeatureThis change adds a new feature to ESLintruleRelates to ESLint's core rules

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions