blob: 6a5395e57976fe14b5310b30c64464f9dbe9cd25 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
|
/**
* @fileoverview Disallow the use of process.env()
* @author Vignesh Anand
* @copyright 2014 Vignesh Anand. All rights reserved.
*/
"use strict";
//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------
module.exports = function(context) {
return {
"MemberExpression": function(node) {
var objectName = node.object.name,
propertyName = node.property.name;
if (objectName === "process" && !node.computed && propertyName && propertyName === "env") {
context.report(node, "Unexpected use of process.env.");
}
}
};
};
module.exports.schema = [];
|