question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Problem with no-callback-literal

See original GitHub issue

I fail to see what’s invalid with the following code, what makes this callback literal?

  ], (err, result) => {
    callback(...response(err, (result ? result.paymentProvider : '')))
  })

results in

Unexpected literal in error position of callback  standard/no-callback-literal

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:12 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
catdaddy23commented, Jan 6, 2018

I agree. It should be removed all together

Sent from my iPhone

On Jan 5, 2018, at 5:12 PM, Bret Comnes notifications@github.com wrote:

I’m guessing the rule semantics didn’t take spread operators into account. Perhaps there is a newer version of he rule?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or mute the thread.

0reactions
ferosscommented, Aug 12, 2019
Read more comments on GitHub >

github_iconTop Results From Across the Web

eslint-plugin-node/no-callback-literal.md at master - GitHub
When a function is named cb or callback , then it must be invoked with a first argument that is undefined , null...
Read more >
Unexpected literal in error position of callback in Vue.JS
It seems like it's caused by some code linting tool you use. It thinks that you need to pass error as the first...
Read more >
14 Linting Rules To Help You Write Asynchronous Code in ...
9. node/no-callback-literal. This rule enforces that a callback function is called with an Error object as the first parameter. In case there's no...
Read more >
Documentation - Do's and Don'ts - TypeScript
Overloads and Callbacks ... ): void;. ❔ Why: It's always legal for a callback to disregard a parameter, so there's no need for...
Read more >
Eslint-plugin-standard NPM - npm.io
no-callback-literal - Ensures that we strictly follow the callback pattern with undefined , null or an error object in the first position of...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found