Skip to content

vue-doctor/security/no-eval ​

Replace eval() with a safe alternative: JSON.parse() for data, or a lookup table of functions for dynamic behaviour

PropertyValue
CategorySecurity
Default Severityerror
Confidencehigh
FixableNo
Engineoxlint
Sincev1.0.0
Frameworksvue, nuxt
CWECWE-95
OWASPA03:2021

Why it matters ​

Replace eval() with a safe alternative: JSON.parse() for data, or a lookup table of functions for dynamic behaviour

How to fix ​

Review the finding and update the code according to best practices below.

Agent Guidance ​

Remove eval(). Use JSON.parse for data, a lookup table or function map for dynamic dispatch, and never build code from strings.


Rule source: vue-doctor/security/no-eval

Released under the MIT License.