Add ESLint unicorn plugin (#627)

Rules disabled by default to allow incremental integration.
This commit is contained in:
filtered
2025-02-27 19:41:51 +11:00
committed by GitHub
parent 9c8cc571e2
commit 6f51767451
6 changed files with 610 additions and 63 deletions

View File

@@ -127,7 +127,7 @@ export class NumberWidget extends BaseWidget implements INumericWidget {
// Handle center click - show prompt
canvas.prompt("Value", this.value, (v: string) => {
// Check if v is a valid equation or a number
if (/^[0-9+\-*/()\s]+|\d+\.\d+$/.test(v)) {
if (/^[\d\s()*+/-]+|\d+\.\d+$/.test(v)) {
// Solve the equation if possible
try {
v = eval(v)