2 * @fileoverview Rule to flag when using new Function
8 //------------------------------------------------------------------------------
10 //------------------------------------------------------------------------------
17 description: "disallow `new` operators with the `Function` object",
18 category: "Best Practices",
20 url: "https://eslint.org/docs/rules/no-new-func"
28 //--------------------------------------------------------------------------
30 //--------------------------------------------------------------------------
34 * @param {ASTNode} node The node to report
38 function report(node) {
39 context.report({ node, message: "The Function constructor is eval." });
43 "NewExpression[callee.name = 'Function']": report,
44 "CallExpression[callee.name = 'Function']": report