File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change 1
1
type EvalResult = {
2
- result : any ,
2
+ result : unknown ,
3
3
error : boolean
4
4
} ;
5
5
@@ -19,12 +19,14 @@ function evaluateExpression(): (expr: string) => EvalResult {
19
19
try {
20
20
try {
21
21
const wrapped = `(${ expr } )` ;
22
- const validate = new Function ( wrapped ) ; // eslint-disable-line
23
- newExpr = wrapped ; // eslint-disable-line
22
+ // eslint-disable-next-line no-new-func
23
+ const validate = new Function ( wrapped ) ;
24
+ newExpr = wrapped ;
24
25
} catch ( e ) {
25
26
// We shouldn't wrap the expression
26
27
}
27
- result = ( 0 , eval ) ( newExpr ) ; // eslint-disable-line
28
+ // eslint-disable-next-line no-eval
29
+ result = ( 0 , eval ) ( newExpr ) ;
28
30
} catch ( e ) {
29
31
if ( e instanceof Error ) {
30
32
result = `${ e . name } : ${ e . message } ` ;
You can’t perform that action at this time.
0 commit comments