]>
Commit | Line | Data |
---|---|---|
eb39fafa DC |
1 | /** |
2 | * @fileoverview Rule to flag use of eval() statement | |
3 | * @author Nicholas C. Zakas | |
4 | */ | |
5 | ||
6 | //------------------------------------------------------------------------------ | |
7 | // Rule Definition | |
8 | //------------------------------------------------------------------------------ | |
9 | ||
10 | module.exports = function(context) { | |
11 | ||
12 | "use strict"; | |
13 | ||
14 | return { | |
15 | "CallExpression": function(node) { | |
16 | if (node.callee.name === "eval") { | |
17 | context.report(node, "eval sucks."); | |
18 | } | |
19 | } | |
20 | }; | |
21 | ||
22 | }; |