Rules
Every rule from ESLint, Oxlint and Biome. Pick a rule to see its example. Reach is the weekly npm downloads of the presets that enable a rule; trend is its change over the last quarter.
Every rule from ESLint, Oxlint and Biome. Pick a rule to see its example. Reach is the weekly npm downloads of the presets that enable a rule; trend is its change over the last quarter.
function callback(err, data) {
console.log('Callback got called with:', err, data)
throw new Error('My error')
}
Promise.resolve()
.then(() => callback(null, 'data'))
.catch((err) => callback(err.message, null))Promise.resolve()
.then((data) => { console.log(data) })
.catch((err) => { console.error(err) })Popular · 1 of 50
Disallow calling cb() inside of a then() (use [util.callbackify][] instead).
function callback(err, data) {
console.log('Callback got called with:', err, data)
throw new Error('My error')
}
Promise.resolve()
.then(() => callback(null, 'data'))
.catch((err) => callback(err.message, null))Promise.resolve()
.then((data) => { console.log(data) })
.catch((err) => { console.error(err) })