--- source: crates/biome_js_analyze/tests/spec_tests.rs expression: invalidParentsWithHigherPrecedence.js --- # Input ```jsx + Math.pow(a, b); - Math.pow(a, b); ! Math.pow(a, b); typeof Math.pow(a, b); void Math.pow(a, b); Math.pow(a, b) .toString(); Math.pow(a, b) (); Math.pow(a, b) ``; (class extends Math.pow(a, b) {}) // parents with a higher precedence, but the expression's role doesn't require parens f(Math.pow(a, b)) f(foo, Math.pow(a, b)) f(Math.pow(a, b), foo) f(foo, Math.pow(a, b), bar) new F(Math.pow(a, b)) new F(foo, Math.pow(a, b)) new F(Math.pow(a, b), foo) new F(foo, Math.pow(a, b), bar) obj[Math.pow(a, b)] [foo, Math.pow(a, b), bar] ``` # Diagnostics ``` invalidParentsWithHigherPrecedence.js:1:3 lint/style/useExponentiationOperator FIXABLE ━━━━━━━━━━━ ! Use the '**' operator instead of 'Math.pow'. > 1 │ + Math.pow(a, b); │ ^^^^^^^^^^^^^^ 2 │ - Math.pow(a, b); 3 │ ! Math.pow(a, b); i Unsafe fix: Use the '**' operator instead of 'Math.pow'. 1 │ - +·Math.pow(a,·b); 1 │ + +·(a·**·b); 2 2 │ - Math.pow(a, b); 3 3 │ ! Math.pow(a, b); ``` ``` invalidParentsWithHigherPrecedence.js:2:3 lint/style/useExponentiationOperator FIXABLE ━━━━━━━━━━━ ! Use the '**' operator instead of 'Math.pow'. 1 │ + Math.pow(a, b); > 2 │ - Math.pow(a, b); │ ^^^^^^^^^^^^^^ 3 │ ! Math.pow(a, b); 4 │ typeof Math.pow(a, b); i Unsafe fix: Use the '**' operator instead of 'Math.pow'. 1 1 │ + Math.pow(a, b); 2 │ - -·Math.pow(a,·b); 2 │ + -·(a·**·b); 3 3 │ ! Math.pow(a, b); 4 4 │ typeof Math.pow(a, b); ``` ``` invalidParentsWithHigherPrecedence.js:3:3 lint/style/useExponentiationOperator FIXABLE ━━━━━━━━━━━ ! Use the '**' operator instead of 'Math.pow'. 1 │ + Math.pow(a, b); 2 │ - Math.pow(a, b); > 3 │ ! Math.pow(a, b); │ ^^^^^^^^^^^^^^ 4 │ typeof Math.pow(a, b); 5 │ void Math.pow(a, b); i Unsafe fix: Use the '**' operator instead of 'Math.pow'. 1 1 │ + Math.pow(a, b); 2 2 │ - Math.pow(a, b); 3 │ - !·Math.pow(a,·b); 3 │ + !·(a·**·b); 4 4 │ typeof Math.pow(a, b); 5 5 │ void Math.pow(a, b); ``` ``` invalidParentsWithHigherPrecedence.js:4:8 lint/style/useExponentiationOperator FIXABLE ━━━━━━━━━━━ ! Use the '**' operator instead of 'Math.pow'. 2 │ - Math.pow(a, b); 3 │ ! Math.pow(a, b); > 4 │ typeof Math.pow(a, b); │ ^^^^^^^^^^^^^^ 5 │ void Math.pow(a, b); 6 │ Math.pow(a, b) .toString(); i Unsafe fix: Use the '**' operator instead of 'Math.pow'. 2 2 │ - Math.pow(a, b); 3 3 │ ! Math.pow(a, b); 4 │ - typeof·Math.pow(a,·b); 4 │ + typeof·(a·**·b); 5 5 │ void Math.pow(a, b); 6 6 │ Math.pow(a, b) .toString(); ``` ``` invalidParentsWithHigherPrecedence.js:5:6 lint/style/useExponentiationOperator FIXABLE ━━━━━━━━━━━ ! Use the '**' operator instead of 'Math.pow'. 3 │ ! Math.pow(a, b); 4 │ typeof Math.pow(a, b); > 5 │ void Math.pow(a, b); │ ^^^^^^^^^^^^^^ 6 │ Math.pow(a, b) .toString(); 7 │ Math.pow(a, b) (); i Unsafe fix: Use the '**' operator instead of 'Math.pow'. 3 3 │ ! Math.pow(a, b); 4 4 │ typeof Math.pow(a, b); 5 │ - void·Math.pow(a,·b); 5 │ + void·(a·**·b); 6 6 │ Math.pow(a, b) .toString(); 7 7 │ Math.pow(a, b) (); ``` ``` invalidParentsWithHigherPrecedence.js:6:1 lint/style/useExponentiationOperator FIXABLE ━━━━━━━━━━━ ! Use the '**' operator instead of 'Math.pow'. 4 │ typeof Math.pow(a, b); 5 │ void Math.pow(a, b); > 6 │ Math.pow(a, b) .toString(); │ ^^^^^^^^^^^^^^ 7 │ Math.pow(a, b) (); 8 │ Math.pow(a, b) ``; i Unsafe fix: Use the '**' operator instead of 'Math.pow'. 4 4 │ typeof Math.pow(a, b); 5 5 │ void Math.pow(a, b); 6 │ - Math.pow(a,·b)·.toString(); 6 │ + (a·**·b)·.toString(); 7 7 │ Math.pow(a, b) (); 8 8 │ Math.pow(a, b) ``; ``` ``` invalidParentsWithHigherPrecedence.js:7:1 lint/style/useExponentiationOperator FIXABLE ━━━━━━━━━━━ ! Use the '**' operator instead of 'Math.pow'. 5 │ void Math.pow(a, b); 6 │ Math.pow(a, b) .toString(); > 7 │ Math.pow(a, b) (); │ ^^^^^^^^^^^^^^ 8 │ Math.pow(a, b) ``; 9 │ (class extends Math.pow(a, b) {}) i Unsafe fix: Use the '**' operator instead of 'Math.pow'. 5 5 │ void Math.pow(a, b); 6 6 │ Math.pow(a, b) .toString(); 7 │ - Math.pow(a,·b)·(); 7 │ + (a·**·b)·(); 8 8 │ Math.pow(a, b) ``; 9 9 │ (class extends Math.pow(a, b) {}) ``` ``` invalidParentsWithHigherPrecedence.js:8:1 lint/style/useExponentiationOperator FIXABLE ━━━━━━━━━━━ ! Use the '**' operator instead of 'Math.pow'. 6 │ Math.pow(a, b) .toString(); 7 │ Math.pow(a, b) (); > 8 │ Math.pow(a, b) ``; │ ^^^^^^^^^^^^^^ 9 │ (class extends Math.pow(a, b) {}) 10 │ i Unsafe fix: Use the '**' operator instead of 'Math.pow'. 6 6 │ Math.pow(a, b) .toString(); 7 7 │ Math.pow(a, b) (); 8 │ - Math.pow(a,·b)·``; 8 │ + (a·**·b)·``; 9 9 │ (class extends Math.pow(a, b) {}) 10 10 │ ``` ``` invalidParentsWithHigherPrecedence.js:9:16 lint/style/useExponentiationOperator FIXABLE ━━━━━━━━━━ ! Use the '**' operator instead of 'Math.pow'. 7 │ Math.pow(a, b) (); 8 │ Math.pow(a, b) ``; > 9 │ (class extends Math.pow(a, b) {}) │ ^^^^^^^^^^^^^^ 10 │ 11 │ // parents with a higher precedence, but the expression's role doesn't require parens i Unsafe fix: Use the '**' operator instead of 'Math.pow'. 7 7 │ Math.pow(a, b) (); 8 8 │ Math.pow(a, b) ``; 9 │ - (class·extends·Math.pow(a,·b)·{}) 9 │ + (class·extends·(a·**·b)·{}) 10 10 │ 11 11 │ // parents with a higher precedence, but the expression's role doesn't require parens ``` ``` invalidParentsWithHigherPrecedence.js:12:3 lint/style/useExponentiationOperator FIXABLE ━━━━━━━━━━ ! Use the '**' operator instead of 'Math.pow'. 11 │ // parents with a higher precedence, but the expression's role doesn't require parens > 12 │ f(Math.pow(a, b)) │ ^^^^^^^^^^^^^^ 13 │ f(foo, Math.pow(a, b)) 14 │ f(Math.pow(a, b), foo) i Unsafe fix: Use the '**' operator instead of 'Math.pow'. 10 10 │ 11 11 │ // parents with a higher precedence, but the expression's role doesn't require parens 12 │ - f(Math.pow(a,·b)) 12 │ + f(a·**·b) 13 13 │ f(foo, Math.pow(a, b)) 14 14 │ f(Math.pow(a, b), foo) ``` ``` invalidParentsWithHigherPrecedence.js:13:8 lint/style/useExponentiationOperator FIXABLE ━━━━━━━━━━ ! Use the '**' operator instead of 'Math.pow'. 11 │ // parents with a higher precedence, but the expression's role doesn't require parens 12 │ f(Math.pow(a, b)) > 13 │ f(foo, Math.pow(a, b)) │ ^^^^^^^^^^^^^^ 14 │ f(Math.pow(a, b), foo) 15 │ f(foo, Math.pow(a, b), bar) i Unsafe fix: Use the '**' operator instead of 'Math.pow'. 11 11 │ // parents with a higher precedence, but the expression's role doesn't require parens 12 12 │ f(Math.pow(a, b)) 13 │ - f(foo,·Math.pow(a,·b)) 13 │ + f(foo,·a·**·b) 14 14 │ f(Math.pow(a, b), foo) 15 15 │ f(foo, Math.pow(a, b), bar) ``` ``` invalidParentsWithHigherPrecedence.js:14:3 lint/style/useExponentiationOperator FIXABLE ━━━━━━━━━━ ! Use the '**' operator instead of 'Math.pow'. 12 │ f(Math.pow(a, b)) 13 │ f(foo, Math.pow(a, b)) > 14 │ f(Math.pow(a, b), foo) │ ^^^^^^^^^^^^^^ 15 │ f(foo, Math.pow(a, b), bar) 16 │ new F(Math.pow(a, b)) i Unsafe fix: Use the '**' operator instead of 'Math.pow'. 12 12 │ f(Math.pow(a, b)) 13 13 │ f(foo, Math.pow(a, b)) 14 │ - f(Math.pow(a,·b),·foo) 14 │ + f(a·**·b,·foo) 15 15 │ f(foo, Math.pow(a, b), bar) 16 16 │ new F(Math.pow(a, b)) ``` ``` invalidParentsWithHigherPrecedence.js:15:8 lint/style/useExponentiationOperator FIXABLE ━━━━━━━━━━ ! Use the '**' operator instead of 'Math.pow'. 13 │ f(foo, Math.pow(a, b)) 14 │ f(Math.pow(a, b), foo) > 15 │ f(foo, Math.pow(a, b), bar) │ ^^^^^^^^^^^^^^ 16 │ new F(Math.pow(a, b)) 17 │ new F(foo, Math.pow(a, b)) i Unsafe fix: Use the '**' operator instead of 'Math.pow'. 13 13 │ f(foo, Math.pow(a, b)) 14 14 │ f(Math.pow(a, b), foo) 15 │ - f(foo,·Math.pow(a,·b),·bar) 15 │ + f(foo,·a·**·b,·bar) 16 16 │ new F(Math.pow(a, b)) 17 17 │ new F(foo, Math.pow(a, b)) ``` ``` invalidParentsWithHigherPrecedence.js:16:7 lint/style/useExponentiationOperator FIXABLE ━━━━━━━━━━ ! Use the '**' operator instead of 'Math.pow'. 14 │ f(Math.pow(a, b), foo) 15 │ f(foo, Math.pow(a, b), bar) > 16 │ new F(Math.pow(a, b)) │ ^^^^^^^^^^^^^^ 17 │ new F(foo, Math.pow(a, b)) 18 │ new F(Math.pow(a, b), foo) i Unsafe fix: Use the '**' operator instead of 'Math.pow'. 14 14 │ f(Math.pow(a, b), foo) 15 15 │ f(foo, Math.pow(a, b), bar) 16 │ - new·F(Math.pow(a,·b)) 16 │ + new·F(a·**·b) 17 17 │ new F(foo, Math.pow(a, b)) 18 18 │ new F(Math.pow(a, b), foo) ``` ``` invalidParentsWithHigherPrecedence.js:17:12 lint/style/useExponentiationOperator FIXABLE ━━━━━━━━━━ ! Use the '**' operator instead of 'Math.pow'. 15 │ f(foo, Math.pow(a, b), bar) 16 │ new F(Math.pow(a, b)) > 17 │ new F(foo, Math.pow(a, b)) │ ^^^^^^^^^^^^^^ 18 │ new F(Math.pow(a, b), foo) 19 │ new F(foo, Math.pow(a, b), bar) i Unsafe fix: Use the '**' operator instead of 'Math.pow'. 15 15 │ f(foo, Math.pow(a, b), bar) 16 16 │ new F(Math.pow(a, b)) 17 │ - new·F(foo,·Math.pow(a,·b)) 17 │ + new·F(foo,·a·**·b) 18 18 │ new F(Math.pow(a, b), foo) 19 19 │ new F(foo, Math.pow(a, b), bar) ``` ``` invalidParentsWithHigherPrecedence.js:18:7 lint/style/useExponentiationOperator FIXABLE ━━━━━━━━━━ ! Use the '**' operator instead of 'Math.pow'. 16 │ new F(Math.pow(a, b)) 17 │ new F(foo, Math.pow(a, b)) > 18 │ new F(Math.pow(a, b), foo) │ ^^^^^^^^^^^^^^ 19 │ new F(foo, Math.pow(a, b), bar) 20 │ obj[Math.pow(a, b)] i Unsafe fix: Use the '**' operator instead of 'Math.pow'. 16 16 │ new F(Math.pow(a, b)) 17 17 │ new F(foo, Math.pow(a, b)) 18 │ - new·F(Math.pow(a,·b),·foo) 18 │ + new·F(a·**·b,·foo) 19 19 │ new F(foo, Math.pow(a, b), bar) 20 20 │ obj[Math.pow(a, b)] ``` ``` invalidParentsWithHigherPrecedence.js:19:12 lint/style/useExponentiationOperator FIXABLE ━━━━━━━━━━ ! Use the '**' operator instead of 'Math.pow'. 17 │ new F(foo, Math.pow(a, b)) 18 │ new F(Math.pow(a, b), foo) > 19 │ new F(foo, Math.pow(a, b), bar) │ ^^^^^^^^^^^^^^ 20 │ obj[Math.pow(a, b)] 21 │ [foo, Math.pow(a, b), bar] i Unsafe fix: Use the '**' operator instead of 'Math.pow'. 17 17 │ new F(foo, Math.pow(a, b)) 18 18 │ new F(Math.pow(a, b), foo) 19 │ - new·F(foo,·Math.pow(a,·b),·bar) 19 │ + new·F(foo,·a·**·b,·bar) 20 20 │ obj[Math.pow(a, b)] 21 21 │ [foo, Math.pow(a, b), bar] ``` ``` invalidParentsWithHigherPrecedence.js:20:5 lint/style/useExponentiationOperator FIXABLE ━━━━━━━━━━ ! Use the '**' operator instead of 'Math.pow'. 18 │ new F(Math.pow(a, b), foo) 19 │ new F(foo, Math.pow(a, b), bar) > 20 │ obj[Math.pow(a, b)] │ ^^^^^^^^^^^^^^ 21 │ [foo, Math.pow(a, b), bar] 22 │ i Unsafe fix: Use the '**' operator instead of 'Math.pow'. 18 18 │ new F(Math.pow(a, b), foo) 19 19 │ new F(foo, Math.pow(a, b), bar) 20 │ - obj[Math.pow(a,·b)] 20 │ + obj[a·**·b] 21 21 │ [foo, Math.pow(a, b), bar] 22 22 │ ``` ``` invalidParentsWithHigherPrecedence.js:21:7 lint/style/useExponentiationOperator FIXABLE ━━━━━━━━━━ ! Use the '**' operator instead of 'Math.pow'. 19 │ new F(foo, Math.pow(a, b), bar) 20 │ obj[Math.pow(a, b)] > 21 │ [foo, Math.pow(a, b), bar] │ ^^^^^^^^^^^^^^ 22 │ i Unsafe fix: Use the '**' operator instead of 'Math.pow'. 19 19 │ new F(foo, Math.pow(a, b), bar) 20 20 │ obj[Math.pow(a, b)] 21 │ - [foo,·Math.pow(a,·b),·bar] 21 │ + [foo,·a·**·b,·bar] 22 22 │ ```