Skip to content

Commit c67d841

Browse files
committed
evaluateExpression: address comments
1 parent c4af496 commit c67d841

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

client/utils/evaluateExpression.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
type EvalResult = {
2-
result: any,
2+
result: unknown,
33
error: boolean
44
};
55

@@ -19,12 +19,14 @@ function evaluateExpression(): (expr: string) => EvalResult {
1919
try {
2020
try {
2121
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;
2425
} catch (e) {
2526
// We shouldn't wrap the expression
2627
}
27-
result = (0, eval)(newExpr); // eslint-disable-line
28+
// eslint-disable-next-line no-eval
29+
result = (0, eval)(newExpr);
2830
} catch (e) {
2931
if (e instanceof Error) {
3032
result = `${e.name}: ${e.message}`;

0 commit comments

Comments
 (0)