27d25d22afb9c7391c9ac0cdf7be20218a738b35
[platform/framework/web/crosswalk-tizen.git] /
1 /**
2  * @fileoverview Rule to disallow use of new operator with the `require` function
3  * @author Wil Moore III
4  */
5
6 "use strict";
7
8 //------------------------------------------------------------------------------
9 // Rule Definition
10 //------------------------------------------------------------------------------
11
12 module.exports = function(context) {
13
14     return {
15
16         "NewExpression": function(node) {
17             if (node.callee.type === "Identifier" && node.callee.name === "require") {
18                 context.report(node, "Unexpected use of new with require.");
19             }
20         }
21     };
22
23 };