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