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

chore: fix rules check snippet to emit an error code #3458

Merged
merged 2 commits into from
Jul 17, 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
6 changes: 3 additions & 3 deletions crates/biome_analyze/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -921,12 +921,12 @@ pub enum Never {}

/// Type alias of [ops::ControlFlow] with the `B` generic type defaulting to [Never]
///
/// By default the analysis loop never breaks, so it behaves mostly like
/// By default, the analysis loop never breaks, so it behaves mostly like
/// `let b = loop {};` and has a "break type" of `!` (the `!` type isn't stable
/// yet so I'm using an empty enum instead but they're identical for this
/// yet, so I'm using an empty enum instead, but they're identical for this
/// purpose)
///
/// In practice it's not really a `loop` but a `for` because it's iterating on
/// In practice, it's not really a `loop` but a `for` because it's iterating on
/// all nodes in the syntax tree, so when it reaches the end of the iterator
/// the loop will exit but without producing a value of type `B`: for this
/// reason the `analyze` function returns an `Option<B>` that's set to
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,18 @@ const IRREGULAR_WHITESPACES: &[char; 22] = &[
declare_lint_rule! {
/// Disallows the use of irregular whitespace characters.
///
/// Invalid or irregular whitespace causes issues with ECMAScript 5 parsers and also makes code harder to debug.
/// Invalid or irregular whitespace causes issues with various parsers and also makes code harder to debug.
///
/// ## Examples
///
/// ### Invalid
///
/// ```js,expect_diagnostic
/// const count = 1;
/// const count;
/// ```
///
/// ```js,expect_diagnostic
/// const foo = 'thing';
/// const foo;
/// ```
///
/// ### Valid
Expand Down Expand Up @@ -67,6 +67,9 @@ impl Rule for NoIrregularWhitespace {
"Irregular whitespaces found."
},
)
.note(markup!{
"Irregular whitespaces can cause issues to other parsers, and make the code harder to debug."
})
.note(markup! {
"Replace the irregular whitespaces with normal whitespaces or tabs."
}),
Expand Down
Loading
Loading