UNPKG

eslint-plugin-better

Version:

Avoid some language features to write better code

12 lines 307 B
module.exports = function(context) { return [ 'ThrowStatement', 'TryStatement', 'CatchClause' ].reduce(function(acc, statement){ acc[statement] = function(node) { return context.report(node, 'Unexpected exception handling statement, return error objects instead'); }; return acc; }, {}); }