Skip to content

fix(linter): add allowImplicit to useIterableCallbackReturn ??????#9674

Closed
raashish1601 wants to merge 2 commits intobiomejs:mainfrom
raashish1601:contributor-12/allow-implicit-9445
Closed

fix(linter): add allowImplicit to useIterableCallbackReturn ??????#9674
raashish1601 wants to merge 2 commits intobiomejs:mainfrom
raashish1601:contributor-12/allow-implicit-9445

Conversation

@raashish1601
Copy link
Copy Markdown

Fixes #9445

Adds an �llowImplicit option to useIterableCallbackReturn so callbacks can use
eturn; intentionally without changing the default behavior. The rule docs, generated configuration surfaces, and analyzer specs are updated together.

Test Plan

ustfmt crates/biome_js_analyze/src/lint/suspicious/use_iterable_callback_return.rs crates/biome_rule_options/src/use_iterable_callback_return.rs

  • git diff --check
  • cargo run -p xtask_codegen --features schema -- schema (fails in this environment: disk and Windows toolchain constraints)
  • cargo test -p biome_js_analyze -- use_iterable_callback_return --show-output (fails in this environment: compiler memory / metadata failures after building deep into the workspace)

Docs

  • Rustdoc for useIterableCallbackReturn now documents the new �llowImplicit option.

This PR was created with AI assistance (Codex).

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Mar 29, 2026

🦋 Changeset detected

Latest commit: 9989ab3

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

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Mar 29, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 09d1fa69-6485-47f4-9a62-2bd8a97230e4

📥 Commits

Reviewing files that changed from the base of the PR and between c17e08e and 9989ab3.

⛔ Files ignored due to path filters (4)
  • crates/biome_js_analyze/tests/specs/suspicious/useIterableCallbackReturn/allowImplicitInvalid.js.snap is excluded by !**/*.snap and included by **
  • crates/biome_js_analyze/tests/specs/suspicious/useIterableCallbackReturn/allowImplicitValid.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 (7)
  • .changeset/allow-implicit-iterable-callback-return.md
  • crates/biome_js_analyze/src/lint/suspicious/use_iterable_callback_return.rs
  • crates/biome_js_analyze/tests/specs/suspicious/useIterableCallbackReturn/allowImplicitInvalid.js
  • crates/biome_js_analyze/tests/specs/suspicious/useIterableCallbackReturn/allowImplicitInvalid.options.json
  • crates/biome_js_analyze/tests/specs/suspicious/useIterableCallbackReturn/allowImplicitValid.js
  • crates/biome_js_analyze/tests/specs/suspicious/useIterableCallbackReturn/allowImplicitValid.options.json
  • crates/biome_rule_options/src/use_iterable_callback_return.rs

Walkthrough

Added an allowImplicit configuration option to the useIterableCallbackReturn lint rule. When enabled, the rule permits callbacks to use bare return; statements when returning undefined is intentional. Changes include updates to the rule logic to read the option and suppress missing-return-value diagnostics under specified conditions, new configuration structures in the options module, test fixtures demonstrating valid and invalid scenarios, and a changeset entry documenting the fix.

Possibly related PRs

Suggested reviewers

  • dyc3
  • ematipico
🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarises the main change: adding an allowImplicit option to the useIterableCallbackReturn linter rule.
Description check ✅ Passed The description relates to the changeset, explaining the allowImplicit option addition and referencing issue #9445, though some words appear truncated.
Linked Issues check ✅ Passed The PR successfully addresses #9445 by implementing the allowImplicit option, enabling bare return statements in iterable callbacks and preserving default behaviour.
Out of Scope Changes check ✅ Passed All changes are directly scoped to implementing the allowImplicit option for useIterableCallbackReturn, including rule logic, configuration, tests, and documentation.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@github-actions github-actions Bot added A-Linter Area: linter L-JavaScript Language: JavaScript and super languages labels Mar 29, 2026
@codspeed-hq
Copy link
Copy Markdown

codspeed-hq Bot commented Mar 29, 2026

Merging this PR will not alter performance

✅ 58 untouched benchmarks
⏩ 168 skipped benchmarks1


Comparing raashish1601:contributor-12/allow-implicit-9445 (9989ab3) with main (c17e08e)2

Open in CodSpeed

Footnotes

  1. 168 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.

  2. No successful run was found on main (cc6f2f6) during the generation of this report, so c17e08e was used instead as the comparison base. There might be some changes unrelated to this pull request in this report.

@Conaclos Conaclos added the M-Likely Agent Meta: this was likely an automated PR without a human in the loop label Mar 29, 2026
@ematipico ematipico closed this Mar 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-Linter Area: linter L-JavaScript Language: JavaScript and super languages M-Likely Agent Meta: this was likely an automated PR without a human in the loop

Projects

None yet

Development

Successfully merging this pull request may close these issues.

💅 lint/suspicious/useIterableCallbackReturn makes impossible to explicitly return undefined

3 participants