no-eval
Configuration
rslint.config.ts
Rule Details
Disallow the use of eval(). JavaScript's eval() function is potentially dangerous and is often misused. Using eval() on untrusted code can open a program up to several different injection attacks. The use of eval() in most contexts can be substituted for a better, alternative approach to a problem.
Examples of incorrect code for this rule:
Examples of correct code for this rule:
Options
This rule has an option to allow indirect calls to eval. Indirect calls to eval are less dangerous than direct calls because they cannot dynamically change the scope.
With { "allowIndirect": true }, the following patterns are correct: