Skip to content

Adopt no-callback-literal rule #178

Closed
@feross

Description

@feross

Hi there!

I'd like to deprecate eslint-plugin-standard. We currently have four rules, three of which are no longer used by us since ESLint core now has suitable alternatives built-in.

The fourth rule is quite useful.

no-callback-literal - Ensures the Node.js error-first callback pattern is followed. Specifically, when a function is named cb or callback, then it must be called with undefined, null or an Error object as the first function argument.

// okay
cb(undefined)
cb(null, 5)
callback(new Error('some error'))
callback(someVariable)

// error
cb('this is an error string')
cb({ a: 1 })
callback(0)

We have code and tests for the implementation (https://github.com/standard/eslint-plugin-standard/blob/master/rules/no-callback-literal.js).

Ideally, we'd be able to just deprecate eslint-plugin-standard since we're currently maintaining a whole ESLint plugin just for a single rule.

So, my question is – would eslint-plugin-node like to adopt this rule? It seems like a good fit. Let me know what you think!

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