diff options
Diffstat (limited to 'tools')
-rw-r--r-- | tools/eslint-rules/new-with-error.js | 31 |
1 files changed, 0 insertions, 31 deletions
diff --git a/tools/eslint-rules/new-with-error.js b/tools/eslint-rules/new-with-error.js deleted file mode 100644 index 655f34bf08..0000000000 --- a/tools/eslint-rules/new-with-error.js +++ /dev/null @@ -1,31 +0,0 @@ -/** - * @fileoverview Require `throw new Error()` rather than `throw Error()` - * @author Rich Trott - */ -'use strict'; - -//------------------------------------------------------------------------------ -// Rule Definition -//------------------------------------------------------------------------------ - -module.exports = function(context) { - - var errorList = context.options.length !== 0 ? context.options : ['Error']; - - return { - 'ThrowStatement': function(node) { - if (node.argument.type === 'CallExpression' && - errorList.indexOf(node.argument.callee.name) !== -1) { - context.report(node, 'Use new keyword when throwing.'); - } - } - }; -}; - -module.exports.schema = { - 'type': 'array', - 'additionalItems': { - 'type': 'string' - }, - 'uniqueItems': true -}; |