Closed as not planned
Description
Environment
ESLint Playground
What parser are you using?
Default (Espree)
What did you do?
Playground Code
const add = new Function("a", "b", "return a + b;");
const BypassFunction = function () {}.constructor;
const sub = new BypassFunction("a", "b", "return a - b;");
// https://developer.mozilla.org/Web/JavaScript/Reference/Global_Objects/AsyncFunction
const AsyncFunction = async function () {}.constructor;
const mul = new AsyncFunction("a", "b", "return a * b;");
ESLint Configuration
Tap to see full config
export default [
{
"rules": {
"no-new-func": [
"error"
]
}
}
];
ESLint Output
1:13 The Function constructor is eval. (no-new-func)
What did you expect to happen?
1:13 The Function constructor is eval. (no-new-func)
4:13 The Function constructor is eval. (no-new-func)
8:13 The AsyncFunction constructor is eval. (no-new-func)
What actually happened?
1:13 The Function constructor is eval. (no-new-func)
Link to Minimal Reproducible Example
Participation
- I am willing to submit a pull request for this issue.
Additional comments
No response
Metadata
Metadata
Assignees
Type
Projects
Status
Complete