Reports using the Function constructor to create functions from strings.
✅ This rule is included in the ts logical presets.
Using the Function constructor to create functions from strings is similar to eval() and introduces security risks and performance issues.
Code passed to the Function constructor is executed in the global scope, making it harder to optimize and potentially allowing arbitrary code execution if user input is involved.
If you have a legitimate need to dynamically generate functions from strings at runtime and have properly sanitized all inputs, you might choose to disable this rule.
However, in most cases there are safer alternatives to achieve the same goal.