Files
memecoin-botV2/.pnpm-store/v10/files/72/52da853ee51ab42853a9c5e0ed31b0fe99a35b06189b6c8228c029d030d748b00d981464794c71883952659c52252f2a48c4c8381a712901fe21e14c16c1e0

43 lines
852 B
Plaintext

/**
* @fileoverview Rule to flag when deleting variables
* @author Ilya Volodin
*/
"use strict";
//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------
/** @type {import('../types').Rule.RuleModule} */
module.exports = {
meta: {
type: "suggestion",
docs: {
description: "Disallow deleting variables",
recommended: true,
url: "https://eslint.org/docs/latest/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" });
}
},
};
},
};