Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(docs): improve wording of docs for global Number rules #2210

Merged
merged 1 commit into from
Mar 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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