chore(docs): minor updates for contributing and skills#10098
Conversation
|
WalkthroughTwo documentation updates that refine lint rule development guidance. The first generalises the generated lint-rule file path from JavaScript-specific locations to language-parameterized paths, and introduces a policy requiring all new lint rules to be placed in the Possibly related PRs
Suggested labels
Suggested reviewers
🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
crates/biome_analyze/CONTRIBUTING.md (1)
1010-1032:⚠️ Potential issue | 🟠 MajorFix the multi-signal example's return type.
The code declares
type Signals = Option<Box<[Self::State]>>but returns a bare boxed slice without the outerOptionwrapper. Additionally, the.map(|write| Some(range))creates unwanted nested Options. The return should beSome(write_ranges.into_boxed_slice())and the map should yield barerangevalues instead.Suggested correction
let write_ranges = write_references.into_iter().map(|write| { let syntax = write.syntax(); let range = syntax.text_range(); - Some(range) + range }).collect::<Vec<_>>(); - write_ranges.into_boxed_slice() + Some(write_ranges.into_boxed_slice())🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@crates/biome_analyze/CONTRIBUTING.md` around lines 1010 - 1032, The example's declared Signals type (type Signals = Option<Box<[Self::State]>>) doesn't match the returned value: in run(...) you collect write_ranges as a boxed slice but forget to wrap it in Some, and the map currently produces nested Options via .map(|write| Some(range)); change the map to yield the bare range from binding.all_writes(...) (e.g., .map(|write| write.syntax().text_range()) ) and return Some(write_ranges.into_boxed_slice()) so run returns an Option<Box<[Self::State]>> as declared.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In @.claude/skills/lint-rule-development/SKILL.md:
- Line 34: Update the document SKILL.md to fix the example scaffold path: find
the string
"crates/biome_<language>_analyze/src/lint/nursery/use_my_rule_name.rs" and
change it to include the missing lib/ segment so it reads
"crates/biome_<language>_analyze/lib/src/lint/nursery/use_my_rule_name.rs"; also
search the file for any other occurrences of the incorrect "/src/lint/" pattern
and correct them to "/lib/src/lint/" to ensure all contributor guidance points
to the actual scaffold location.
---
Outside diff comments:
In `@crates/biome_analyze/CONTRIBUTING.md`:
- Around line 1010-1032: The example's declared Signals type (type Signals =
Option<Box<[Self::State]>>) doesn't match the returned value: in run(...) you
collect write_ranges as a boxed slice but forget to wrap it in Some, and the map
currently produces nested Options via .map(|write| Some(range)); change the map
to yield the bare range from binding.all_writes(...) (e.g., .map(|write|
write.syntax().text_range()) ) and return Some(write_ranges.into_boxed_slice())
so run returns an Option<Box<[Self::State]>> as declared.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 1f66f340-0b91-472c-91ff-09141cc22299
📒 Files selected for processing (2)
.claude/skills/lint-rule-development/SKILL.mdcrates/biome_analyze/CONTRIBUTING.md
| ``` | ||
|
|
||
| This creates a file in `crates/biome_js_analyze/src/lint/nursery/use_my_rule_name.rs` | ||
| This creates a file in `crates/biome_<language>_analyze/src/lint/nursery/use_my_rule_name.rs` |
There was a problem hiding this comment.
Fix the generated rule file path (missing lib/).
Line 34 points contributors to .../src/lint/..., but the scaffolded rule files live under .../lib/src/lint/.... This is likely to send first-time contributors to the wrong folder.
Suggested doc fix
-This creates a file in `crates/biome_<language>_analyze/src/lint/nursery/use_my_rule_name.rs`
+This creates a file in `crates/biome_<language>_analyze/lib/src/lint/nursery/use_my_rule_name.rs`📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| This creates a file in `crates/biome_<language>_analyze/src/lint/nursery/use_my_rule_name.rs` | |
| This creates a file in `crates/biome_<language>_analyze/lib/src/lint/nursery/use_my_rule_name.rs` |
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In @.claude/skills/lint-rule-development/SKILL.md at line 34, Update the
document SKILL.md to fix the example scaffold path: find the string
"crates/biome_<language>_analyze/src/lint/nursery/use_my_rule_name.rs" and
change it to include the missing lib/ segment so it reads
"crates/biome_<language>_analyze/lib/src/lint/nursery/use_my_rule_name.rs"; also
search the file for any other occurrences of the incorrect "/src/lint/" pattern
and correct them to "/lib/src/lint/" to ensure all contributor guidance points
to the actual scaffold location.
Summary
as requested in #10093. we already had most of the desired guidance in place, this just fixes some things i saw along the way.
Test Plan
Docs