From 56b5c1372907ac577f2bd510109e08685fe4f005 Mon Sep 17 00:00:00 2001 From: Stephen Cresswell <229672+cressie176@users.noreply.github.com> Date: Thu, 4 Sep 2025 17:09:26 +0100 Subject: [PATCH] Use modern exponentiation operator instead of Math.pow() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Replace Math.pow() with ** operator in test/data.js - Remove explicit useExponentiationOperator config as it's enabled by default - Update changelog with exponentiation operator entry - Improves readability with modern JavaScript syntax 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude --- CHANGELOG.md | 1 + biome.json | 3 +-- test/data.js | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d2e9f6e2..a44b879b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,7 @@ - Add block scoping to switch statement cases to prevent variable declaration issues - Enforce const usage for variables that are never reassigned - Add node: protocol prefix to Node.js builtin module imports for clarity +- Use modern exponentiation operator (**) instead of Math.pow() ## v0.10.9 - Add support for IPv6 urls diff --git a/biome.json b/biome.json index 09c1cce2..940dd3e7 100644 --- a/biome.json +++ b/biome.json @@ -20,8 +20,7 @@ "useLiteralKeys": "off" }, "style": { - "useTemplate": "off", - "useExponentiationOperator": "off" + "useTemplate": "off" }, "suspicious": { "noRedundantUseStrict": "off", diff --git a/test/data.js b/test/data.js index 2eab14bc..bcd76153 100644 --- a/test/data.js +++ b/test/data.js @@ -50,7 +50,7 @@ function floatChooser(maxExp) { while (isNaN(n)) { const mantissa = Math.random() * 2 - 1; const exponent = chooseInt(0, maxExp); - n = Math.pow(mantissa, exponent); + n = mantissa ** exponent; } return n; };