no-implied-eval
eslint
No autofix
eslint.config.js
export default [
{
rules: {
"no-implied-eval": "error",
},
},
];/*global window, setTimeout, setInterval, execScript*/
setTimeout("alert('Hi!');", 100);
setInterval("alert('Hi!');", 100);
execScript("alert('Hi!')");
window.setTimeout("count = 5", 10);
window.setInterval("foo = bar", 10);/*global setTimeout, setInterval*/
setTimeout(function() {
alert("Hi!");
}, 100);
setInterval(function() {
alert("Hi!");
}, 100);Examples from the ESLint documentation.
no-implied-eval
eslint
export default [
{
rules: {
"no-implied-eval": "error",
},
},
];no-implied-eval
eslint plugin · suspicious
{
"rules": {
"no-implied-eval": "error"
}
}nursery/noImpliedEval
nursery · since 2.4.10
{
"linter": {
"rules": {
"nursery": {
"noImpliedEval": "error"
}
}
}
}Disallow the use of eval()-like functions
Disallow octal escape sequences in string literals
Disallow comparisons where both sides are exactly the same