Blame view
node_modules/eslint/lib/rules/no-delete-var.js
603 Bytes
c39994410
|
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 |
/** * @fileoverview Rule to flag when deleting variables * @author Ilya Volodin */ "use strict"; //------------------------------------------------------------------------------ // Rule Definition //------------------------------------------------------------------------------ module.exports = function(context) { return { "UnaryExpression": function(node) { if (node.operator === "delete" && node.argument.type === "Identifier") { context.report(node, "Variables should not be deleted."); } } }; }; module.exports.schema = []; |