/** * Copyright (c) 2025 Ofri Peretz * Licensed under the MIT License. Use of this source code is governed by the * MIT license that can be found in the LICENSE file. */ /** * ESLint Rule: detect-eval-with-expression * Detects eval(variable) which can allow an attacker to run arbitrary code * LLM-optimized with comprehensive fix guidance and security context * * @see https://owasp.org/www-community/attacks/Code_Injection * @see https://cwe.mitre.org/data/definitions/95.html */ import type { TSESLint } from '@interlace/eslint-devkit'; type MessageIds = 'evalWithExpression' | 'useJsonParse' | 'useObjectAccess' | 'useTemplateLiteral' | 'useFunctionConstructor' | 'useSaferAlternative' | 'strategyRemove' | 'strategyRefactor' | 'strategyValidate'; export interface Options { /** Allow eval with literal strings. Default: false (stricter) */ allowLiteralStrings?: boolean; /** Additional functions to treat as eval-like */ additionalEvalFunctions?: string[]; /** Strategy for fixing eval usage: 'remove', 'refactor', 'validate', or 'auto' */ strategy?: 'remove' | 'refactor' | 'validate' | 'auto'; } type RuleOptions = [Options?]; export declare const detectEvalWithExpression: TSESLint.RuleModule & { name: string; }; export {};