Skip to content

fix(lint/js): improve diagnostics to better follow rule pillars#9880

Merged
dyc3 merged 1 commit intomainfrom
dyc3/better-rule-diagnostics
Apr 9, 2026
Merged

fix(lint/js): improve diagnostics to better follow rule pillars#9880
dyc3 merged 1 commit intomainfrom
dyc3/better-rule-diagnostics

Conversation

@dyc3
Copy link
Copy Markdown
Contributor

@dyc3 dyc3 commented Apr 9, 2026

Summary

This PR improves the diagnostics for some of our rules.

Test Plan

snapshots

Docs

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Apr 9, 2026

🦋 Changeset detected

Latest commit: 78420fe

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 labels Apr 9, 2026
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 9, 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: 66fc6401-f570-4541-98e1-4ded50690371

📥 Commits

Reviewing files that changed from the base of the PR and between 565f3ca and 78420fe.

⛔ Files ignored due to path filters (3)
  • crates/biome_js_analyze/tests/specs/nursery/useArraySome/invalid.js.snap is excluded by !**/*.snap and included by **
  • crates/biome_js_analyze/tests/specs/nursery/useFind/invalid.ts.snap is excluded by !**/*.snap and included by **
  • crates/biome_js_analyze/tests/specs/nursery/useRegexpExec/invalid.js.snap is excluded by !**/*.snap and included by **
📒 Files selected for processing (6)
  • .changeset/empty-dryers-fix.md
  • .changeset/fuzzy-beers-shine.md
  • .changeset/polite-buckets-juggle.md
  • crates/biome_js_analyze/src/lint/nursery/use_array_some.rs
  • crates/biome_js_analyze/src/lint/nursery/use_find.rs
  • crates/biome_js_analyze/src/lint/nursery/use_regexp_exec.rs
✅ Files skipped from review due to trivial changes (4)
  • .changeset/fuzzy-beers-shine.md
  • .changeset/polite-buckets-juggle.md
  • .changeset/empty-dryers-fix.md
  • crates/biome_js_analyze/src/lint/nursery/use_find.rs
🚧 Files skipped from review as they are similar to previous changes (2)
  • crates/biome_js_analyze/src/lint/nursery/use_regexp_exec.rs
  • crates/biome_js_analyze/src/lint/nursery/use_array_some.rs

Walkthrough

This PR updates diagnostic messages for three nursery JS lints: useArraySome, useFind, and useRegexpExec. It replaces generic descriptions with pattern-specific problem/reason text, adds contextual notes and conditional “how to fix” guidance, and tweaks some control flow/formatting in use_array_some. Three Changeset markdown files were added to bump @biomejs/biome as patch releases. No public APIs or exported declarations were changed.

Suggested labels

A-Diagnostic

Suggested reviewers

  • ematipico
🚥 Pre-merge checks | ✅ 2
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarises the main change: improving diagnostics for linting rules to follow rule pillars, which is directly reflected in the file modifications.
Description check ✅ Passed The description is related to the changeset, mentioning that it improves diagnostics for some rules and references snapshots as the test plan, which aligns with the PR objectives.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch dyc3/better-rule-diagnostics

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

@codspeed-hq
Copy link
Copy Markdown

codspeed-hq Bot commented Apr 9, 2026

Merging this PR will not alter performance

✅ 58 untouched benchmarks
⏩ 196 skipped benchmarks1


Comparing dyc3/better-rule-diagnostics (78420fe) with main (ce7e2b7)

Open in CodSpeed

Footnotes

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

Comment thread crates/biome_js_analyze/tests/specs/nursery/useArraySome/invalid.js.snap Outdated
Comment thread crates/biome_js_analyze/tests/specs/nursery/useFind/invalid.ts.snap Outdated
Copy link
Copy Markdown
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.

Few nits, but it's a good improvement!

@dyc3 dyc3 force-pushed the dyc3/better-rule-diagnostics branch from 565f3ca to 78420fe Compare April 9, 2026 14:06
@dyc3 dyc3 merged commit 7f67749 into main Apr 9, 2026
19 checks passed
@dyc3 dyc3 deleted the dyc3/better-rule-diagnostics branch April 9, 2026 14:35
@github-actions github-actions Bot mentioned this pull request Apr 9, 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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants