Skip to content
This repository has been archived by the owner on Aug 31, 2023. It is now read-only.

Commit

Permalink
rename rule useExponentiation to useExponentiationOperator
Browse files Browse the repository at this point in the history
  • Loading branch information
kaioduarte committed Nov 26, 2022
1 parent 00bd90f commit 42eb1b4
Show file tree
Hide file tree
Showing 27 changed files with 20 additions and 20 deletions.
2 changes: 1 addition & 1 deletion crates/rome_diagnostics_categories/src/categories.rs
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ define_dategories! {
"lint/nursery/useConst":"https://docs.rome.tools/lint/rules/useConst",
"lint/nursery/useDefaultSwitchClauseLast":"https://docs.rome.tools/lint/rules/useDefaultSwitchClauseLast",
"lint/nursery/useExhaustiveDependencies": "https://docs.rome.tools/lint/rules/useExhaustiveDependencies",
"lint/nursery/useExponentiation": "https://docs.rome.tools/lint/rules/useExponentiation",
"lint/nursery/useExponentiationOperator": "https://docs.rome.tools/lint/rules/useExponentiationOperator",
"lint/nursery/useFlatMap": "https://docs.rome.tools/lint/rules/useFlatMap",
"lint/nursery/useNumericLiterals": "https://docs.rome.tools/lint/rules/useNumericLiterals",
"lint/nursery/useValidForDirection": "https://docs.rome.tools/lint/rules/useValidForDirection",
Expand Down
4 changes: 2 additions & 2 deletions crates/rome_js_analyze/src/analyzers/nursery.rs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -48,14 +48,14 @@ declare_rule! {
/// let quux = (-1) ** n;
/// ```
///
pub(crate) UseExponentiation {
pub(crate) UseExponentiationOperator {
version: "11.0.0",
name: "useExponentiation",
name: "useExponentiationOperator",
recommended: false,
}
}

impl Rule for UseExponentiation {
impl Rule for UseExponentiationOperator {
type Query = Ast<JsCallExpression>;
type State = ();
type Signals = Option<Self::State>;
Expand Down
4 changes: 2 additions & 2 deletions crates/rome_service/src/configuration/linter/rules.rs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion editors/vscode/configuration_schema.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions npm/backend-jsonrpc/src/workspace.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion npm/rome/configuration_schema.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions website/src/pages/lint/rules/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -577,8 +577,8 @@ Enforce default clauses in switch statements to be last
Enforce all dependencies are correctly specified.
</section>
<section class="rule">
<h3 data-toc-exclude id="useExponentiation">
<a href="/lint/rules/useExponentiation">useExponentiation</a>
<h3 data-toc-exclude id="useExponentiationOperator">
<a href="/lint/rules/useExponentiationOperator">useExponentiationOperator</a>
</h3>
Disallow the use of <code>Math.pow</code> in favor of the <code>**</code> operator.
</section>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
---
title: Lint Rule useExponentiation
title: Lint Rule useExponentiationOperator
parent: lint/rules/index
---

# useExponentiation (since v11.0.0)
# useExponentiationOperator (since v11.0.0)

Disallow the use of `Math.pow` in favor of the `**` operator.

Expand All @@ -21,7 +21,7 @@ Source: https://eslint.org/docs/latest/rules/prefer-exponentiation-operator
const foo = Math.pow(2, 8);
```

<pre class="language-text"><code class="language-text">nursery/useExponentiation.js:1:13 <a href="https://docs.rome.tools/lint/rules/useExponentiation">lint/nursery/useExponentiation</a> <span style="color: #000; background-color: #ddd;"> FIXABLE </span> ━━━━━━━━━━━━━━━━━━━━━━━━━
<pre class="language-text"><code class="language-text">nursery/useExponentiationOperator.js:1:13 <a href="https://docs.rome.tools/lint/rules/useExponentiationOperator">lint/nursery/useExponentiationOperator</a> <span style="color: #000; background-color: #ddd;"> FIXABLE </span> ━━━━━━━━━━

<strong><span style="color: Orange;"> </span></strong><strong><span style="color: Orange;">⚠</span></strong> <span style="color: Orange;">Use the '**' operator instead of 'Math.pow'.</span>

Expand All @@ -41,7 +41,7 @@ const foo = Math.pow(2, 8);
const bar = Math.pow(a, b);
```

<pre class="language-text"><code class="language-text">nursery/useExponentiation.js:1:13 <a href="https://docs.rome.tools/lint/rules/useExponentiation">lint/nursery/useExponentiation</a> <span style="color: #000; background-color: #ddd;"> FIXABLE </span> ━━━━━━━━━━━━━━━━━━━━━━━━━
<pre class="language-text"><code class="language-text">nursery/useExponentiationOperator.js:1:13 <a href="https://docs.rome.tools/lint/rules/useExponentiationOperator">lint/nursery/useExponentiationOperator</a> <span style="color: #000; background-color: #ddd;"> FIXABLE </span> ━━━━━━━━━━

<strong><span style="color: Orange;"> </span></strong><strong><span style="color: Orange;">⚠</span></strong> <span style="color: Orange;">Use the '**' operator instead of 'Math.pow'.</span>

Expand All @@ -61,7 +61,7 @@ const bar = Math.pow(a, b);
let baz = Math.pow(a + b, c + d);
```

<pre class="language-text"><code class="language-text">nursery/useExponentiation.js:1:11 <a href="https://docs.rome.tools/lint/rules/useExponentiation">lint/nursery/useExponentiation</a> <span style="color: #000; background-color: #ddd;"> FIXABLE </span> ━━━━━━━━━━━━━━━━━━━━━━━━━
<pre class="language-text"><code class="language-text">nursery/useExponentiationOperator.js:1:11 <a href="https://docs.rome.tools/lint/rules/useExponentiationOperator">lint/nursery/useExponentiationOperator</a> <span style="color: #000; background-color: #ddd;"> FIXABLE </span> ━━━━━━━━━━

<strong><span style="color: Orange;"> </span></strong><strong><span style="color: Orange;">⚠</span></strong> <span style="color: Orange;">Use the '**' operator instead of 'Math.pow'.</span>

Expand All @@ -81,7 +81,7 @@ let baz = Math.pow(a + b, c + d);
let quux = Math.pow(-1, n);
```

<pre class="language-text"><code class="language-text">nursery/useExponentiation.js:1:12 <a href="https://docs.rome.tools/lint/rules/useExponentiation">lint/nursery/useExponentiation</a> <span style="color: #000; background-color: #ddd;"> FIXABLE </span> ━━━━━━━━━━━━━━━━━━━━━━━━━
<pre class="language-text"><code class="language-text">nursery/useExponentiationOperator.js:1:12 <a href="https://docs.rome.tools/lint/rules/useExponentiationOperator">lint/nursery/useExponentiationOperator</a> <span style="color: #000; background-color: #ddd;"> FIXABLE </span> ━━━━━━━━━━

<strong><span style="color: Orange;"> </span></strong><strong><span style="color: Orange;">⚠</span></strong> <span style="color: Orange;">Use the '**' operator instead of 'Math.pow'.</span>

Expand Down

0 comments on commit 42eb1b4

Please sign in to comment.