Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@Netail
Copy link
Member

@Netail Netail commented Oct 24, 2025

Summary

Port Eslint's no-continue

Test Plan

Docs

@changeset-bot
Copy link

changeset-bot bot commented Oct 24, 2025

🦋 Changeset detected

Latest commit: 40bfcfe

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 13 packages
Name Type
@biomejs/biome Patch
@biomejs/cli-win32-x64 Patch
@biomejs/cli-win32-arm64 Patch
@biomejs/cli-darwin-x64 Patch
@biomejs/cli-darwin-arm64 Patch
@biomejs/cli-linux-x64 Patch
@biomejs/cli-linux-arm64 Patch
@biomejs/cli-linux-x64-musl Patch
@biomejs/cli-linux-arm64-musl Patch
@biomejs/wasm-web Patch
@biomejs/wasm-bundler Patch
@biomejs/wasm-nodejs Patch
@biomejs/backend-jsonrpc Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions github-actions bot added A-Linter Area: linter L-JavaScript Language: JavaScript and super languages A-Diagnostic Area: diagnostocis labels Oct 24, 2025
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Oct 24, 2025

Walkthrough

Adds a changeset entry for the package @biomejs/biome. Introduces a new JavaScript lint rule NoContinue that matches continue statements and emits a diagnostic with an explanatory note. Adds a unit-like NoContinueOptions type (serializable/deserializable) and exports its module from the rule options crate. Adds tests: invalid.js containing various continue usages and valid.js with loop examples that should not trigger diagnostics.

Suggested reviewers

  • dyc3
  • ematipico

Pre-merge checks and finishing touches

✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The pull request title 'feat(lint): implement noContinue' clearly and concisely summarises the main change—adding a new lint rule called noContinue. It uses conventional commit formatting and directly reflects the changeset, which introduces the noContinue rule across multiple files including the rule implementation, test cases, and options.
Description check ✅ Passed The pull request description directly relates to the changeset by explaining that this PR ports ESLint's no-continue rule into Biome. It provides context about the ESLint source and includes placeholders for test plans and documentation. Whilst the placeholders are unfilled, the core description is clearly relevant to the implementation of the noContinue rule shown in the changeset.
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

📜 Recent review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 7563e02 and 40bfcfe.

📒 Files selected for processing (1)
  • .changeset/yellow-crews-guess.md (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • .changeset/yellow-crews-guess.md
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (14)
  • GitHub Check: Test Node.js API
  • GitHub Check: Bench (biome_js_parser)
  • GitHub Check: Bench (biome_configuration)
  • GitHub Check: Bench (biome_js_analyze)
  • GitHub Check: Check JS Files
  • GitHub Check: Bench (biome_js_formatter)
  • GitHub Check: Documentation
  • GitHub Check: Test (depot-ubuntu-24.04-arm-16)
  • GitHub Check: End-to-end tests
  • GitHub Check: Test (depot-windows-2022-16)
  • GitHub Check: autofix
  • GitHub Check: Lint project (depot-windows-2022)
  • GitHub Check: Lint project (depot-ubuntu-24.04-arm-16)
  • GitHub Check: Check Dependencies

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🧹 Nitpick comments (3)
crates/biome_rule_options/src/no_continue.rs (1)

1-6: Looks solid; please add inline rustdoc for options.

Derives and serde attributes are spot‑on. Add a brief rustdoc explaining the rule and that there are currently no options.

Apply:

+/// Options for the `noContinue` rule.
+///
+/// This rule disallows the `continue` statement in iteration constructs.
+/// Currently, this rule has no configuration options.
 pub struct NoContinueOptions {}

As per coding guidelines.

crates/biome_js_analyze/tests/specs/nursery/noContinue/invalid.js (1)

1-4: Broaden invalid coverage to tricky control‑flow corners.

Nice spread. Add a few gotchas to harden the rule:

  • do…while with continue.
  • for…of and for…in.
  • continue inside a switch nested within a loop.
  • Nested loops with an outer label target.

Example additions:

do { if (cond) { continue; } } while (cond2);

for (const x of xs) { if (x) { continue; } }

for (const k in obj) { if (k === 'x') { continue; } }

outer: for (let i = 0; i < 3; i++) {
  for (let j = 0; j < 3; j++) {
    if (j === 1) { continue outer; }
  }
}

while (true) {
  switch (state) {
    case 0:
      if (ok) { continue; } // continues the loop
      break;
  }
  break;
}
crates/biome_js_analyze/tests/specs/nursery/noContinue/valid.js (1)

1-3: Add positive examples mirroring edge cases without continue.

To mirror the new invalids, add structured alternatives:

let i = 0;
do {
  if (!cond) { /* work */ }
  i++;
} while (i < n);

for (const x of xs) {
  if (!x) { /* work */ }
}

for (const k in obj) {
  if (k !== 'x') { /* work */ }
}

outer: for (let i = 0; i < 3; i++) {
  for (let j = 0; j < 3; j++) {
    if (j !== 1) { /* work */ }
  }
}
📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between ee2f5bf and acb830d.

⛔ Files ignored due to path filters (4)
  • crates/biome_diagnostics_categories/src/categories.rs is excluded by !**/categories.rs and included by **
  • crates/biome_js_analyze/src/lint/nursery.rs is excluded by !**/nursery.rs and included by **
  • crates/biome_js_analyze/tests/specs/nursery/noContinue/invalid.js.snap is excluded by !**/*.snap and included by **
  • crates/biome_js_analyze/tests/specs/nursery/noContinue/valid.js.snap is excluded by !**/*.snap and included by **
📒 Files selected for processing (6)
  • .changeset/yellow-crews-guess.md (1 hunks)
  • crates/biome_js_analyze/src/lint/nursery/no_continue.rs (1 hunks)
  • crates/biome_js_analyze/tests/specs/nursery/noContinue/invalid.js (1 hunks)
  • crates/biome_js_analyze/tests/specs/nursery/noContinue/valid.js (1 hunks)
  • crates/biome_rule_options/src/lib.rs (1 hunks)
  • crates/biome_rule_options/src/no_continue.rs (1 hunks)
🧰 Additional context used
📓 Path-based instructions (5)
crates/biome_*/**

📄 CodeRabbit inference engine (CLAUDE.md)

Place core crates under /crates/biome_*/

Files:

  • crates/biome_rule_options/src/lib.rs
  • crates/biome_js_analyze/src/lint/nursery/no_continue.rs
  • crates/biome_rule_options/src/no_continue.rs
  • crates/biome_js_analyze/tests/specs/nursery/noContinue/invalid.js
  • crates/biome_js_analyze/tests/specs/nursery/noContinue/valid.js
**/*.rs

📄 CodeRabbit inference engine (CONTRIBUTING.md)

**/*.rs: Format Rust files before committing (e.g., via just f which formats Rust)
Document rules, assists, and options with inline rustdoc in source

Files:

  • crates/biome_rule_options/src/lib.rs
  • crates/biome_js_analyze/src/lint/nursery/no_continue.rs
  • crates/biome_rule_options/src/no_continue.rs
crates/biome_*_{syntax,parser,formatter,analyze,factory,semantic}/**

📄 CodeRabbit inference engine (CLAUDE.md)

Maintain the per-language crate structure: biome_{lang}_{syntax,parser,formatter,analyze,factory,semantic}

Files:

  • crates/biome_js_analyze/src/lint/nursery/no_continue.rs
  • crates/biome_js_analyze/tests/specs/nursery/noContinue/invalid.js
  • crates/biome_js_analyze/tests/specs/nursery/noContinue/valid.js
.changeset/*.md

📄 CodeRabbit inference engine (CONTRIBUTING.md)

.changeset/*.md: In changesets, only use #### or ##### headers; other header levels are not allowed
Changesets should cover user-facing changes only; internal changes do not need changesets
Use past tense for what you did and present tense for current Biome behavior in changesets
When fixing a bug in a changeset, start with an issue link (e.g., “Fixed #1234: …”)
When referencing a rule or assist in a changeset, include a link to its page on the website
Include code blocks in changesets when applicable to illustrate changes
End every sentence in a changeset with a period

Files:

  • .changeset/yellow-crews-guess.md
**/tests/**

📄 CodeRabbit inference engine (CLAUDE.md)

Place test files under a tests/ directory in each crate

Files:

  • crates/biome_js_analyze/tests/specs/nursery/noContinue/invalid.js
  • crates/biome_js_analyze/tests/specs/nursery/noContinue/valid.js
🧠 Learnings (6)
📚 Learning: 2025-10-24T21:24:58.631Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-10-24T21:24:58.631Z
Learning: Applies to crates/biome_analyze/crates/biome_rule_options/lib/**/*.rs : Place per-rule options types in biome_rule_options crate under lib/, one file per rule

Applied to files:

  • crates/biome_rule_options/src/lib.rs
  • crates/biome_rule_options/src/no_continue.rs
📚 Learning: 2025-10-24T21:24:58.631Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-10-24T21:24:58.631Z
Learning: Applies to crates/biome_analyze/crates/*_analyze/**/src/**/lint/**/*.rs : In declare_lint_rule! macros, set version: "next"

Applied to files:

  • crates/biome_js_analyze/src/lint/nursery/no_continue.rs
📚 Learning: 2025-10-24T21:24:58.631Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-10-24T21:24:58.631Z
Learning: Applies to crates/biome_analyze/crates/*_analyze/**/src/lint/nursery/**/*.rs : Place all new rules in the nursery group

Applied to files:

  • crates/biome_js_analyze/src/lint/nursery/no_continue.rs
📚 Learning: 2025-10-24T21:24:58.631Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-10-24T21:24:58.631Z
Learning: Applies to crates/biome_analyze/crates/*_analyze/**/src/**/lint/**/*.rs : Set the language field in declare_lint_rule! to the most appropriate dialect (js/jsx/ts/tsx)

Applied to files:

  • crates/biome_js_analyze/src/lint/nursery/no_continue.rs
📚 Learning: 2025-10-24T21:24:58.631Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-10-24T21:24:58.631Z
Learning: Applies to crates/biome_analyze/crates/biome_rule_options/lib/**/*.rs : Derive Serialize, Deserialize, and Deserializable for rule options; add #[serde(rename_all = "camelCase", deny_unknown_fields, default)]

Applied to files:

  • crates/biome_rule_options/src/no_continue.rs
📚 Learning: 2025-10-24T21:24:58.631Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-10-24T21:24:58.631Z
Learning: Applies to crates/biome_analyze/crates/biome_rule_options/lib/**/*.rs : When schema feature is enabled, derive schemars::JsonSchema for options and related enums

Applied to files:

  • crates/biome_rule_options/src/no_continue.rs
🧬 Code graph analysis (1)
crates/biome_js_analyze/src/lint/nursery/no_continue.rs (1)
crates/biome_analyze/src/rule.rs (3)
  • recommended (595-598)
  • sources (610-613)
  • same (246-251)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (11)
  • GitHub Check: Documentation
  • GitHub Check: Test (depot-windows-2022-16)
  • GitHub Check: Check Dependencies
  • GitHub Check: Lint project (depot-windows-2022)
  • GitHub Check: Test (depot-ubuntu-24.04-arm-16)
  • GitHub Check: Validate rules documentation
  • GitHub Check: autofix
  • GitHub Check: Bench (biome_js_formatter)
  • GitHub Check: Bench (biome_js_parser)
  • GitHub Check: Bench (biome_js_analyze)
  • GitHub Check: Test Node.js API
🔇 Additional comments (1)
crates/biome_js_analyze/src/lint/nursery/no_continue.rs (1)

59-63: No issues found—implementation is correct.

NoContinueOptions is an empty struct with no fields, so the run method correctly returns Some(()) unconditionally. The rule should flag all continue statements, which matches ESLint's no-continue behaviour. No configuration checks are needed.

Likely an incorrect or invalid review comment.

@github-actions github-actions bot added A-CLI Area: CLI A-Project Area: project labels Oct 24, 2025
@codspeed-hq
Copy link

codspeed-hq bot commented Oct 24, 2025

CodSpeed Performance Report

Merging #7856 will not alter performance

Comparing Netail:feat/no-continue (40bfcfe) with main (547c2da)

Summary

✅ 53 untouched
⏩ 85 skipped1

Footnotes

  1. 85 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

♻️ Duplicate comments (1)
.changeset/yellow-crews-guess.md (1)

5-5: URL slug and tense issues already flagged.

The past review comment comprehensively covers the required corrections (camelCase URL and tense consistency).

🧹 Nitpick comments (1)
crates/biome_js_analyze/tests/specs/nursery/noContinue/valid.js (1)

1-3: Consider expanding test coverage with additional valid scenarios.

The current test cases correctly demonstrate valid patterns without continue. Consider optionally adding:

  • Code with break statements (to confirm they're allowed)
  • Nested loops
  • Other loop types (for-of, for-in, do-while)
📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 4241018 and e519896.

⛔ Files ignored due to path filters (8)
  • crates/biome_cli/src/execute/migrate/eslint_any_rule_to_biome.rs is excluded by !**/migrate/eslint_any_rule_to_biome.rs and included by **
  • crates/biome_configuration/src/analyzer/linter/rules.rs is excluded by !**/rules.rs and included by **
  • crates/biome_diagnostics_categories/src/categories.rs is excluded by !**/categories.rs and included by **
  • crates/biome_js_analyze/src/lint/nursery.rs is excluded by !**/nursery.rs and included by **
  • crates/biome_js_analyze/tests/specs/nursery/noContinue/invalid.js.snap is excluded by !**/*.snap and included by **
  • crates/biome_js_analyze/tests/specs/nursery/noContinue/valid.js.snap is excluded by !**/*.snap and included by **
  • packages/@biomejs/backend-jsonrpc/src/workspace.ts is excluded by !**/backend-jsonrpc/src/workspace.ts and included by **
  • packages/@biomejs/biome/configuration_schema.json is excluded by !**/configuration_schema.json and included by **
📒 Files selected for processing (6)
  • .changeset/yellow-crews-guess.md (1 hunks)
  • crates/biome_js_analyze/src/lint/nursery/no_continue.rs (1 hunks)
  • crates/biome_js_analyze/tests/specs/nursery/noContinue/invalid.js (1 hunks)
  • crates/biome_js_analyze/tests/specs/nursery/noContinue/valid.js (1 hunks)
  • crates/biome_rule_options/src/lib.rs (1 hunks)
  • crates/biome_rule_options/src/no_continue.rs (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (3)
  • crates/biome_rule_options/src/lib.rs
  • crates/biome_js_analyze/tests/specs/nursery/noContinue/invalid.js
  • crates/biome_rule_options/src/no_continue.rs
🧰 Additional context used
📓 Path-based instructions (5)
crates/biome_*_{syntax,parser,formatter,analyze,factory,semantic}/**

📄 CodeRabbit inference engine (CLAUDE.md)

Maintain the per-language crate structure: biome_{lang}_{syntax,parser,formatter,analyze,factory,semantic}

Files:

  • crates/biome_js_analyze/tests/specs/nursery/noContinue/valid.js
  • crates/biome_js_analyze/src/lint/nursery/no_continue.rs
crates/biome_*/**

📄 CodeRabbit inference engine (CLAUDE.md)

Place core crates under /crates/biome_*/

Files:

  • crates/biome_js_analyze/tests/specs/nursery/noContinue/valid.js
  • crates/biome_js_analyze/src/lint/nursery/no_continue.rs
**/tests/**

📄 CodeRabbit inference engine (CLAUDE.md)

Place test files under a tests/ directory in each crate

Files:

  • crates/biome_js_analyze/tests/specs/nursery/noContinue/valid.js
**/*.rs

📄 CodeRabbit inference engine (CONTRIBUTING.md)

**/*.rs: Format Rust files before committing (e.g., via just f which formats Rust)
Document rules, assists, and options with inline rustdoc in source

Files:

  • crates/biome_js_analyze/src/lint/nursery/no_continue.rs
.changeset/*.md

📄 CodeRabbit inference engine (CONTRIBUTING.md)

.changeset/*.md: In changesets, only use #### or ##### headers; other header levels are not allowed
Changesets should cover user-facing changes only; internal changes do not need changesets
Use past tense for what you did and present tense for current Biome behavior in changesets
When fixing a bug in a changeset, start with an issue link (e.g., “Fixed #1234: …”)
When referencing a rule or assist in a changeset, include a link to its page on the website
Include code blocks in changesets when applicable to illustrate changes
End every sentence in a changeset with a period

Files:

  • .changeset/yellow-crews-guess.md
🧠 Learnings (1)
📚 Learning: 2025-10-24T21:24:58.631Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-10-24T21:24:58.631Z
Learning: Applies to crates/biome_analyze/crates/*_analyze/**/src/**/lint/**/*.rs : In declare_lint_rule! macros, set version: "next"

Applied to files:

  • crates/biome_js_analyze/src/lint/nursery/no_continue.rs
🧬 Code graph analysis (1)
crates/biome_js_analyze/src/lint/nursery/no_continue.rs (2)
packages/@biomejs/backend-jsonrpc/src/workspace.ts (1)
  • NoContinueOptions (8248-8248)
crates/biome_analyze/src/rule.rs (3)
  • recommended (595-598)
  • sources (610-613)
  • same (246-251)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (14)
  • GitHub Check: Documentation
  • GitHub Check: Test (depot-windows-2022-16)
  • GitHub Check: End-to-end tests
  • GitHub Check: Test (depot-ubuntu-24.04-arm-16)
  • GitHub Check: Lint project (depot-windows-2022)
  • GitHub Check: Lint project (depot-ubuntu-24.04-arm-16)
  • GitHub Check: Check Dependencies
  • GitHub Check: Bench (biome_js_formatter)
  • GitHub Check: Bench (biome_js_analyze)
  • GitHub Check: Bench (biome_js_parser)
  • GitHub Check: Check JS Files
  • GitHub Check: Test Node.js API
  • GitHub Check: autofix
  • GitHub Check: Bench (biome_configuration)
🔇 Additional comments (3)
crates/biome_js_analyze/src/lint/nursery/no_continue.rs (3)

1-8: LGTM!

Imports are appropriate and correctly scoped for the rule implementation.


9-53: Well-documented rule with correct configuration.

The rule declaration follows all guidelines. Version "next", ESLint source attribution, and comprehensive rustdoc examples are all correct. Based on learnings.


55-80: LGTM!

The Rule implementation correctly flags all continue statements. The diagnostic message is clear, and the explanatory note provides appropriate rationale.

Copy link
Member

@ematipico ematipico left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can't believe there's a lint rule like this one. continue is so useful!

Left some comments to address

type Options = NoContinueOptions;

fn run(_ctx: &RuleContext<Self>) -> Self::Signals {
Some(())
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't we check if this is inside a loop? That's what the docs say

Copy link
Member Author

@Netail Netail Oct 25, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mhm, the source code of Eslint doesn't either 🤔.
Could also be confusing to use in switch statements

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, the docs and the rule must match. Docs are usually in higher order, and the code follows

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will add a mention of switch statements in the docs :)

Copy link
Member Author

@Netail Netail Oct 30, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, what am I saying lol. Switch statements don't use continue 🤦, confused with break for a sec

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The continue statement is only valid syntax in a loop to begin with

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (1)
crates/biome_js_analyze/src/lint/nursery/no_continue.rs (1)

75-77: Consider shortening the diagnostic note.

The note addresses the previous feedback about fix guidance, but it's quite verbose. Since the explanation is already in the rule docs, you could simplify to just the actionable bit:

-.note(markup! {
-    "The continue statement terminates execution of the statements in the current iteration, when used incorrectly it makes code less testable, less readable and less maintainable. Structured control flow statements such as if should be used instead."
-})
+.note(markup! {
+    "Use structured control flow statements such as if instead."
+})
📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between e519896 and 8b4968e.

📒 Files selected for processing (2)
  • .changeset/yellow-crews-guess.md (1 hunks)
  • crates/biome_js_analyze/src/lint/nursery/no_continue.rs (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • .changeset/yellow-crews-guess.md
🧰 Additional context used
📓 Path-based instructions (3)
crates/biome_*_{syntax,parser,formatter,analyze,factory,semantic}/**

📄 CodeRabbit inference engine (CLAUDE.md)

Maintain the per-language crate structure: biome_{lang}_{syntax,parser,formatter,analyze,factory,semantic}

Files:

  • crates/biome_js_analyze/src/lint/nursery/no_continue.rs
crates/biome_*/**

📄 CodeRabbit inference engine (CLAUDE.md)

Place core crates under /crates/biome_*/

Files:

  • crates/biome_js_analyze/src/lint/nursery/no_continue.rs
**/*.rs

📄 CodeRabbit inference engine (CONTRIBUTING.md)

**/*.rs: Format Rust files before committing (e.g., via just f which formats Rust)
Document rules, assists, and options with inline rustdoc in source

Files:

  • crates/biome_js_analyze/src/lint/nursery/no_continue.rs
🧠 Learnings (3)
📚 Learning: 2025-10-24T21:24:58.631Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-10-24T21:24:58.631Z
Learning: Applies to crates/biome_analyze/crates/*_analyze/**/src/**/lint/**/*.rs : In declare_lint_rule! macros, set version: "next"

Applied to files:

  • crates/biome_js_analyze/src/lint/nursery/no_continue.rs
📚 Learning: 2025-10-24T21:24:58.631Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-10-24T21:24:58.631Z
Learning: Applies to crates/biome_analyze/crates/*_analyze/**/src/lint/nursery/**/*.rs : Place all new rules in the nursery group

Applied to files:

  • crates/biome_js_analyze/src/lint/nursery/no_continue.rs
📚 Learning: 2025-10-24T21:24:58.631Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-10-24T21:24:58.631Z
Learning: Applies to crates/biome_analyze/crates/*_analyze/**/src/**/lint/**/*.rs : Rule names should use no<Concept> when forbidding a single concept (e.g., noDebugger)

Applied to files:

  • crates/biome_js_analyze/src/lint/nursery/no_continue.rs
🧬 Code graph analysis (1)
crates/biome_js_analyze/src/lint/nursery/no_continue.rs (2)
packages/@biomejs/backend-jsonrpc/src/workspace.ts (1)
  • NoContinueOptions (8248-8248)
crates/biome_analyze/src/rule.rs (3)
  • recommended (595-598)
  • sources (610-613)
  • same (246-251)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (13)
  • GitHub Check: Bench (biome_configuration)
  • GitHub Check: Test Node.js API
  • GitHub Check: Test (depot-ubuntu-24.04-arm-16)
  • GitHub Check: Lint project (depot-ubuntu-24.04-arm-16)
  • GitHub Check: Lint project (depot-windows-2022)
  • GitHub Check: Documentation
  • GitHub Check: Check Dependencies
  • GitHub Check: Test (depot-windows-2022-16)
  • GitHub Check: Check JS Files
  • GitHub Check: Bench (biome_js_formatter)
  • GitHub Check: Bench (biome_js_parser)
  • GitHub Check: Bench (biome_js_analyze)
  • GitHub Check: autofix
🔇 Additional comments (3)
crates/biome_js_analyze/src/lint/nursery/no_continue.rs (3)

1-7: Imports look good.

All imports are properly used in the implementation.


9-53: Excellent documentation and metadata.

The rule documentation is clear and comprehensive. Metadata follows all conventions: version: "next", noContinue naming pattern, and correct source attribution. The examples effectively demonstrate the rule's intent.


61-63: No loop check needed—parser handles this.

Your response to the previous review is spot-on. The JavaScript parser only produces JsContinueStatement nodes when they're syntactically valid (i.e., inside loops). Any misplaced continue would be a parse error, not an analysis concern.

@Netail Netail requested a review from ematipico November 3, 2025 12:49
"@biomejs/biome": patch
---

Added the nursery rule [`noContinue`](https://biomejs.dev/linter/rules/no-continue/). It disallows the use of the `continue` statement.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I approved it, but it would be nice to reword the changeset to explain better the rule, maybe with a snippet that triggers the rule

@Netail Netail merged commit c9e20c3 into biomejs:main Nov 3, 2025
20 checks passed
@Netail Netail deleted the feat/no-continue branch November 3, 2025 17:17
@github-actions github-actions bot mentioned this pull request Nov 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-CLI Area: CLI A-Diagnostic Area: diagnostocis A-Linter Area: linter A-Project Area: project L-JavaScript Language: JavaScript and super languages

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants