From 57f0ce130009c48ad16bdc7fd6bc598bbef3929d Mon Sep 17 00:00:00 2001 From: sapphi-red <49056869+sapphi-red@users.noreply.github.com> Date: Fri, 7 Nov 2025 05:05:04 +0000 Subject: [PATCH] docs(linter): add backquotes where appropriate (#15407) Added backquotes where appropriate. --- crates/oxc_linter/src/rules/eslint/no_compare_neg_zero.rs | 8 ++++---- .../oxc_linter/src/rules/eslint/no_extra_boolean_cast.rs | 2 +- .../src/rules/eslint/no_unsafe_optional_chaining.rs | 2 +- crates/oxc_linter/src/rules/eslint/use_isnan.rs | 8 ++++---- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/crates/oxc_linter/src/rules/eslint/no_compare_neg_zero.rs b/crates/oxc_linter/src/rules/eslint/no_compare_neg_zero.rs index 157d5ecf70f1e..6965615989515 100644 --- a/crates/oxc_linter/src/rules/eslint/no_compare_neg_zero.rs +++ b/crates/oxc_linter/src/rules/eslint/no_compare_neg_zero.rs @@ -18,13 +18,13 @@ pub struct NoCompareNegZero; declare_oxc_lint!( /// ### What it does /// - /// Disallow comparing against -0 + /// Disallow comparing against `-0` /// /// ### Why is this bad? /// - /// The rule should warn against code that tries to compare against -0, - /// since that will not work as intended. That is, code like x === -0 will - /// pass for both +0 and -0. The author probably intended Object.is(x, -0). + /// The rule should warn against code that tries to compare against `-0`, + /// since that will not work as intended. That is, code like `x === -0` will + /// pass for both `+0` and `-0`. The author probably intended `Object.is(x, -0)`. /// /// ### Examples /// diff --git a/crates/oxc_linter/src/rules/eslint/no_extra_boolean_cast.rs b/crates/oxc_linter/src/rules/eslint/no_extra_boolean_cast.rs index 63e0823bb8906..42daf1aac6ff3 100644 --- a/crates/oxc_linter/src/rules/eslint/no_extra_boolean_cast.rs +++ b/crates/oxc_linter/src/rules/eslint/no_extra_boolean_cast.rs @@ -42,7 +42,7 @@ declare_oxc_lint!( /// ### Why is this bad? /// /// In contexts such as an if statement's test where the result of the expression will already be coerced to a Boolean, - /// casting to a Boolean via double negation (!!) or a Boolean call is unnecessary. + /// casting to a Boolean via double negation (`!!`) or a `Boolean` call is unnecessary. /// /// ### Examples /// diff --git a/crates/oxc_linter/src/rules/eslint/no_unsafe_optional_chaining.rs b/crates/oxc_linter/src/rules/eslint/no_unsafe_optional_chaining.rs index 2e52136ede18a..af2ef54fd0909 100644 --- a/crates/oxc_linter/src/rules/eslint/no_unsafe_optional_chaining.rs +++ b/crates/oxc_linter/src/rules/eslint/no_unsafe_optional_chaining.rs @@ -40,7 +40,7 @@ declare_oxc_lint!( /// /// ### Why is this bad? /// - /// The optional chaining (?.) expression can short-circuit with a return value of undefined. + /// The optional chaining (`?.`) expression can short-circuit with a return value of undefined. /// Therefore, treating an evaluated optional chaining expression as a function, object, number, etc., /// can cause TypeError or unexpected results. For example: /// diff --git a/crates/oxc_linter/src/rules/eslint/use_isnan.rs b/crates/oxc_linter/src/rules/eslint/use_isnan.rs index 3c6c27e0a67c8..a10c13916ad8b 100644 --- a/crates/oxc_linter/src/rules/eslint/use_isnan.rs +++ b/crates/oxc_linter/src/rules/eslint/use_isnan.rs @@ -54,7 +54,7 @@ impl Default for UseIsnan { declare_oxc_lint!( /// ### What it does /// - /// Disallows checking against NaN without using isNaN() call. + /// Disallows checking against NaN without using `isNaN()` call. /// /// ### Why is this bad? /// @@ -65,10 +65,10 @@ declare_oxc_lint!( /// /// Because NaN is unique in JavaScript by not being equal to anything, including itself, /// the results of comparisons to NaN are confusing: - /// - NaN === NaN or NaN == NaN evaluate to false - /// - NaN !== NaN or NaN != NaN evaluate to true + /// - `NaN === NaN` or `NaN == NaN` evaluate to false + /// - `NaN !== NaN` or `NaN != NaN` evaluate to true /// - /// Therefore, use Number.isNaN() or global isNaN() functions to test whether a value is NaN. + /// Therefore, use `Number.isNaN()` or global `isNaN()` functions to test whether a value is NaN. /// /// ### Examples ///