Sha256: 83c2ac4d79fcef8ed8a642191c2b5b0f47a707a3140544192741d0fed9189995
Contents?: true
Size: 1 KB
Versions: 43
Compression:
Stored size: 1 KB
Contents
'use strict' const getDocsUrl = require('./lib/get-docs-url') const isPromise = require('./lib/is-promise') module.exports = { meta: { docs: { url: getDocsUrl('no-return-in-finally') } }, create(context) { return { CallExpression(node) { if (isPromise(node)) { if ( node.callee && node.callee.property && node.callee.property.name === 'finally' ) { if ( node.arguments && node.arguments[0] && node.arguments[0].body && node.arguments[0].body.body ) { if ( node.arguments[0].body.body.some(statement => { return statement.type === 'ReturnStatement' }) ) { context.report({ node: node.callee.property, message: 'No return in finally' }) } } } } } } } }
Version data entries
43 entries across 43 versions & 1 rubygems