Skip to content

Commit

Permalink
fix(docs): improve wording of docs for global Number rules (#2210)
Browse files Browse the repository at this point in the history
  • Loading branch information
LucianBuzzo committed Mar 26, 2024
1 parent 8af7c78 commit 62fbec8
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion crates/biome_js_analyze/src/lint/correctness/use_is_nan.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ declare_rule! {
///
/// Therefore, use `Number.isNaN()` or global `isNaN()` functions to test whether a value is `NaN`.
///
/// Note that `Number.isNaN()` and `isNaN()` [have not the same behavior](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/isNaN#description).
/// Note that `Number.isNaN()` and `isNaN()` [do not have the same behavior](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/isNaN#description).
/// When the argument to `isNaN()` is not a number, the value is first coerced to a number.
/// `Number.isNaN()` does not perform this coercion.
/// Therefore, it is a more reliable way to test whether a value is `NaN`.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ use biome_rowan::{AstNode, BatchMutationExt};
declare_rule! {
/// Use `Number.isFinite` instead of global `isFinite`.
///
/// `Number.isFinite()` and `isFinite()` [have not the same behavior](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/isFinite#difference_between_number.isfinite_and_global_isfinite).
/// `Number.isFinite()` and `isFinite()` [do not have the same behavior](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/isFinite#difference_between_number.isfinite_and_global_isfinite).
/// When the argument to `isFinite()` is not a number, the value is first coerced to a number.
/// `Number.isFinite()` does not perform this coercion.
/// Therefore, it is a more reliable way to test whether a number is finite.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ use biome_rowan::{AstNode, BatchMutationExt};
declare_rule! {
/// Use `Number.isNaN` instead of global `isNaN`.
///
/// `Number.isNaN()` and `isNaN()` [have not the same behavior](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/isNaN#description).
/// `Number.isNaN()` and `isNaN()` [do not have the same behavior](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/isNaN#description).
/// When the argument to `isNaN()` is not a number, the value is first coerced to a number.
/// `Number.isNaN()` does not perform this coercion.
/// Therefore, it is a more reliable way to test whether a value is `NaN`.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ This rule is recommended by Biome. A diagnostic error will appear when linting y

Use `Number.isFinite` instead of global `isFinite`.

`Number.isFinite()` and `isFinite()` [have not the same behavior](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/isFinite#difference_between_number.isfinite_and_global_isfinite).
`Number.isFinite()` and `isFinite()` [do not have the same behavior](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/isFinite#difference_between_number.isfinite_and_global_isfinite).
When the argument to `isFinite()` is not a number, the value is first coerced to a number.
`Number.isFinite()` does not perform this coercion.
Therefore, it is a more reliable way to test whether a number is finite.
Expand Down
2 changes: 1 addition & 1 deletion website/src/content/docs/linter/rules/no-global-is-nan.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ This rule is recommended by Biome. A diagnostic error will appear when linting y

Use `Number.isNaN` instead of global `isNaN`.

`Number.isNaN()` and `isNaN()` [have not the same behavior](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/isNaN#description).
`Number.isNaN()` and `isNaN()` [do not have the same behavior](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/isNaN#description).
When the argument to `isNaN()` is not a number, the value is first coerced to a number.
`Number.isNaN()` does not perform this coercion.
Therefore, it is a more reliable way to test whether a value is `NaN`.
Expand Down
2 changes: 1 addition & 1 deletion website/src/content/docs/linter/rules/use-is-nan.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ Because `NaN` is unique in JavaScript by not being equal to anything, including

Therefore, use `Number.isNaN()` or global `isNaN()` functions to test whether a value is `NaN`.

Note that `Number.isNaN()` and `isNaN()` [have not the same behavior](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/isNaN#description).
Note that `Number.isNaN()` and `isNaN()` [do not have the same behavior](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/isNaN#description).
When the argument to `isNaN()` is not a number, the value is first coerced to a number.
`Number.isNaN()` does not perform this coercion.
Therefore, it is a more reliable way to test whether a value is `NaN`.
Expand Down

0 comments on commit 62fbec8

Please sign in to comment.