node/tools/eslint/lib/rules/no-process-env.js
Roman Reiss d91e10b3bd tools: update eslint to 0.24.0
PR-URL: https://github.com/nodejs/io.js/pull/2072
Reviewed-By: Yosuke Furukawa <yosuke.furukawa@gmail.com>
Reviewed-by: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Alex Kocharin <alex@kocharin.ru>
2015-06-29 19:02:17 +02:00

31 lines
774 B
JavaScript

/**
* @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 = [];