Sha256: c6c5f35972679c2fb2208e14da3c8aca67c92a9f69ef7a4b2045e9df2979bfaa
Contents?: true
Size: 976 Bytes
Versions: 6
Compression:
Stored size: 976 Bytes
Contents
/** * @fileoverview Rule to flag when deleting variables * @author Ilya Volodin */ "use strict"; //------------------------------------------------------------------------------ // Rule Definition //------------------------------------------------------------------------------ /** @type {import('../shared/types').Rule} */ module.exports = { meta: { type: "suggestion", docs: { description: "disallow deleting variables", recommended: true, url: "https://eslint.org/docs/rules/no-delete-var" }, schema: [], messages: { unexpected: "Variables should not be deleted." } }, create(context) { return { UnaryExpression(node) { if (node.operator === "delete" && node.argument.type === "Identifier") { context.report({ node, messageId: "unexpected" }); } } }; } };
Version data entries
6 entries across 6 versions & 1 rubygems